Listening for filter events from Birst in embedded web pages

An embedded web page can listen for filter events that occurs in the Birst application in which it is embedded.

  1. Set up the basic embedding as described.
  2. In the web page, configure a listener for the event. For a filter, use this syntax:
    
          var eventHandler=function(e){
              if(e.data.operation==="setFilters"){
                 alert(JSON.stringify(e.data.filters));
              }
            }
          BirstConfig.callBack(eventHandler)
  3. When an event occurs, the eventHandler function is called in the web page. The e.data.operation is setFilters.

    Example for a filter:

    
    	e.data={operation:'setFilters', filters:[{key:'Time.Year', value:[2012], 
    		operator:'='}]};

    Sample Code: Listen For Filter Events

    The Listen For Filter Events sample shows how to receive data from a parent Birst application when a filter updates. See Listen For Filter Events Example.