on

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.

Parameters

NameTypeDescription
eventNameStringSpecifies a name of the component’s event.
functionFunction|StringSpecifies a name of a JavaScript function or a function itself that should be an event handler for the specified event.

Example

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