loads data from an external file ( xml, json, jsarray, csv )
url | string | url to an external file |
call | function | after loading callback function, optional, can be omitted |
type | string | type of data (xml,csv,json,jsarray), optional, xml by default |
promise | a "promise" object |
//load grid from the external file
myTreeGrid.load("grid.xml");
//load grid, execute doAfterRefresh() function after grid was loaded
myTreeGrid.load("grid.xml",doAfterRefresh);
//load grid from the external csv file,
//execute doAfterRefresh() function after grid was loaded
myTreeGrid.load("grid.csv",doAfterRefresh,"csv");
// returns a "promise" object, see details
myTreeGrid.load(url).then(function(text){
// text - a server side response
});
DHTMLX is integrated with Promiz.js library to treat the result of asynchronous operations (like data loading) without callbacks. Read more about integration of DHTMLX with Promiz.js.