Documentation menu
off
off(eventName:String, functionName:String)
Removes JavaScript event handlers that are attached to a pivot table component with the on() method. Follow the link to see a full list of events.
Parameters
Name | Type | Description |
---|---|---|
eventName | String | Specifies a name of the component’s event. |
functionName | String | optional Specifies a name of the event handler to be removed. If it is not specified, all the event handlers are removed for this event. |
Examples
- Remove all the handlers for the
reportchange
event:webdatarocks.off('reportchange');
- Add a handler to the
reportcomplete
event:webdatarocks.on('reportcomplete', 'onReportComplete');
function onReportComplete(result) {
console.log('The report has been loaded successfully!');
} - Remove the specified handler for the
beforetoolbarcreated
event:webdatarocks.off('beforetoolbarcreated', 'onToolbarCreated');
Note that if you add the event listener the following way:
webdatarocks.on('reportchange', function () {
alert('The report has been changed!');
});
Then it is not possible to remove such a handler by its name. All that is feasible is to remove all the handlers from an event:
webdatarocks.off('reportchange');
See the CodePen demo.
See also