ChartDirector 5.1 (PHP Edition)

JsChartViewer.attachHandler


Usage

attachHandler(eventId, handler)

Description

Attaches a function to be used as the event handler for an event.

Multiple functions may be attached to the same event may be attached by calling this method multiple times, in which case the functions will be called in the sequence of their attachment.

Note that this method expects the function to be a real function object, not a text string. The function will be called as if it is a method of the JsChartViewer object, which means the "this" pointer inside the function represents the JsChartViewer object that calls the function.

Arguments

ArgumentDefaultDescription
eventId(Mandatory)A text string representing the event to attach to.
handler(Mandatory)A function object

Return Value

An handler id representing the attachment of the handler to the event. This id can be used in JsChartViewer.detachHandler to detach the handler.