Loading Data into DataGrid: Overview
DataGrid can load data of various formats, such as:
- JSON;
- XML;
- JsArray;
- CSV.
In addition to the mentioned above, you can define any custom format.
There are two main ways of loading data in DataGrid:
Both ways work in the same way.
Loading data from an inline dataset
Section titled “Loading data from an inline dataset”webix.grid({ data:[ { id:1,name:"The Shawshank Redemption",year:1994}, { id:2,name:"The Godfather",year:1972} ]});
Related sample: Loading from an Inline Data Source
Loading data from a data file
Section titled “Loading data from a data file”webix.grid({ url:"data/data.json"});
Related sample: DataGrid: Loading from Different File Types
The url property can be:
- a string with the path to a file, a script or a service
webix.grid({ url:"data/customers"});
- a function to fetch and parse data into a widget
webix.grid({ autoConfig:true, url:function(){ return fetch("some/path").then(response => response.json()); }});