Skip to content

Loading from Database

To load data from a database table(s), you should deal with both client and server sides.

On the client side, you must define the url parameter (or call the load() method) and specify a server-side script there.

Static loading from db. Client-side code.
webix.grid({
url:"data/table_data.php"
});
// or
grid.load("data/table_data.php");

A server-side response should include the following information:

  • data - the array of data records;
  • pos - the position in the data component to add the loaded data to;
  • total_count - the total number of records available on the server.
Sample of JSON response
{
"data":[
{"id":1,"package":"acx100-source"},
{"id":2,"package":"acx200-source"}
],
"pos":0,
"total_count":999
}

Related sample:  Dynamic Loading from DB