loads data from an external file (xml, json, jsarray, csv)
url | string | an URL to an external file |
type | string | optional, the type of data (xml,csv,json,jsarray), xml by default |
callback | function | optional, an after loading callback function, can be omitted |
promise | a "promise" object |
// load list from an external file
myList.load("list.xml");
// load list, execute doAfterRefresh() function after list was loaded
myList.load("list.xml",doAfterRefresh);
// load list from an external csv file,
// execute doAfterRefresh() function after list was loaded
myList.load("list.csv","csv",doAfterRefresh);
// returns a "promise" object, see details
myList.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.