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
Name | Type | Description |
---|---|---|
eventName | String | Specifies a name of the component’s event. |
function | Function|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.