We have updated WebDataRocks EULA, effective as of April 18, 2024. Learn more about what's changed.
Documentation menu

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
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.

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