loads data from an external data source.

promise load(string url, [string type,function callback] );


urlstringthe data URL
typestring(optional) the type of data to load: "json" (default), "xml", "jsarray", "csv"
callbackfunction(optional) the callback function


promisea "promise" object


$$("mylist").load("data.xml", "xml");

Related samples


The data URL

The url parameter can be set as:

  • string - the path to a file or a script
  • function - the logic that is able to get data and parse them on its own
  return webix.ajax(url).then(function(data){
    return data.json();
  • object - the loading proxy object
  load:function(view, callback, params){
    webix.ajax().bind(view).get(url, params, callback);

Function signatures

The load method can be used with up to three parameters:

  • By default, the data type is set to 'json', so in case of data in JSON format, it can omitted:
  • You can also pass a callback function:
$$('component_id').load("some/path/data.json", function(text, data, http_request){
  // do something with data.json()
  • If you need to specify both the data type and the callback:
$$("component_id").load("some/path/data.xml","xml",function(text, data, http_request){
  // do something with the data object
$$("component_id").load("some/path/data.xml", "xml", {
  error: function(text, data, http_request){
  success:function(text, data, http_request){


By default, the loading is asynchronous, so you will need to use the callback to trigger some action after loading is finished.

The callback function takes 3 parameters:

  1. The text of the response
  2. The data object of the response
  3. The raw HTTP request object

Return Value

The method returns a Promises/A+ compatible promise object than contains the eventual result of an AJAX request.

Webix uses the Promiz.js library for promises. Learn more at:

Error handlers

The callback can be defined as a combination of error and success functions (you can use only one of them if you want to).

Post and synchronous loading

As the load method doesn't provide direct ability to use post and sync, you can use the parse method instead:

// sync data loading
var result = webix.ajax().sync().get("some.json");
// using POST for data loading
var result = webix.ajax().post("mydata.php", "some=value", function (text) {
See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript ui framework and page of javascript pivot product.