parse

loads data to the component from an inline data source

void parse(string|array|object data,string type, [boolean clear] );
data
string|array|objectthe data to add type
stringthe data type: 'json' (default), 'xml', 'csv', 'jsarray' clear
booleanif true, the current data are erased before new data are parsed

Example

webix.ui({
    id:"data",
    view:"dataview",
    ...
});
 
var str = "<data><item id='1'><title>The Lord of the Rings</title>"+
    "<year>2003</year></item>" +
    "<item id='2'><title>Star Wars: Episode V</title>"+
    "<year>1980</year></item></data>";
 
$$("data").parse(str,"xml");

Related samples

Details

The data parameter can have the following types:

To parse data into an existing branch, pass an object with the parent and data fields as a parameter of the method:

$$("tree").parse({
  parent: 2,
  data: [/* data */]
});

Data will be passed into the branch with id of 2.

See also
  • API
  • Articles
  • Back to top
    Join Our Forum
    We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
    If you have not checked yet, be sure to visit site of our main product Webix ui widget library and page of javascript tree widget product.