loads data to the gantt from an external data source
url | string | the server-side url (may be a static file or a server side script that outputs data) |
type | string | ('json', 'xml', 'oldxml') the data type. The default value - 'json' |
callback | function | the callback function |
object | the promise object which resolves when ajax request is completed |
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");
});
The method invokes the onLoadStart and onLoadEnd events.
Note that the method doesn't work in the Gantt version for Node.js.