on - Methods - Reports API

Reports API Methods

on()

Sets up an event listener for the current report. This method binds a callback function that will be invoked whenever the specified eventName is fired.

You would want to use this method so that you can take custom actions in your application when certain defined events occur in the report.

The full list of available event names are listed on the Reports API Events page.

Examples

// Start listening for the 'load:data' event.
reportsApp.getReport('my-report-id').on('load:data', function (event) {
    console.log('This code executes when the report data has loaded.');
});

Arguments

  • eventName string

    Name of the event that you want to start listening to.

  • eventCallback callback

    Callback function that will be triggered whenever the event is fired.

Return value

None (undefined).

Was this article helpful?

Did you arrive here by accident? If so, learn more about Learnosity.