on(eventName:String, function:Function|String)

Attaches a JavaScript event handler to the specified event. Follow the link to see a full list of events.


eventNameString Specifies a name of the component’s event.
functionFunction|String Specifies a name of a JavaScript function or a function itself that should be an event handler for the specified event.


Add an event handler to the 'reportchange' event

webdatarocks.on('reportchange', 'onReportChange');
function onReportChange(result) {
    alert('The report has been changed!');

See the CodePen demo.

See also