load

loads data to the gantt from an external data source

object load(string url, [string type,function callback] );
urlstringthe server-side url (may be a static file or a server side script that outputs data)
typestring('json', 'xml', 'oldxml') the data type. The default value - 'json'
callbackfunctionthe callback function
objectthe promise object which resolves when ajax request is completed

Example

gantt.load("/data",function(){
    gantt.message("everything is ready");
});
//or
gantt.load("/data").then(function(xhr){
    gantt.message("everything is ready");
});
//or
gantt.load("data.json"); //loading data in the JSON format
//or
gantt.load("data.xml","xml"); //loading data in the XML format (version 2.0+)
//or
gantt.load("data.xml","xml", function(){ //specifying the callback function 
    alert("Data has been successfully loaded");
});

Related samples

Details

The method invokes the onLoadStart and onLoadEnd events.

Note that the method doesn't work in the Gantt version for Node.js.

See also
Back to top