EJSC.AjaxDataHandler.onNeedsData

See Also

Top  Previous  Next

 

Definition

 

boolean onNeedsData( EJSC.AjaxDataHandler dataHandler, EJSC.Series series, EJSC.Chart chart )

XMLHttpRequest onNeedsData( EJSC.AjaxDataHandler dataHandler, EJSC.Series series, EJSC.Chart chart )

 

Description

 

This event allows for additional control over when and how data is retrieved by the data handler.  If assigned, the event will be triggered whenever the its owner series has requested the data handler retrieve its data.  The event passes a reference to the current data handler, its owner series and the owner chart.

 

The result of this event is expected to be either a boolean value or an XMLHttpRequest object which has already been retrieved (responseXML is a valid, well-formed chart xml document).

 

RESULT:

 

       true: The data handler will ignore other properties such as url and requestType and hold itself in a loading state and wait for its setXMLData method to be called and provided a valid XMLHttpRequest object.  In this manner, a separate Ajax library may be used to retrieve data.

 

       false: The data handler will ignore other properties such as url and requestType and cancel its loading process.

 

       XMLHttpRequest: The data handler will ignore other properties such as url and requestType and immediately begin processing the data stored in responseXML.