loads data to the component from an inline data source
data | string|array|object | the data to add |
type | string | the data type: 'json' (default), 'xml', 'csv', 'jsarray' |
clear | boolean | if true, the current data are erased before new data are parsed |
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");
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
.