Components, bound to dhtmlXDataStore will keep their data synchronized with the data stored in dhtmlXDataStore. They will also be bound with each other (e.g. grid and form).
var list1 = new dhtmlXDataStore({ url:"../data/data1.json", datatype:"json" }); grid.sync(list1);
var data1 = new dhtmlXDataStore({ url:"../data/data1.json", datatype:"json" }); var data2 = new dhtmlXDataStore({ url:"../data/data2.json", datatype:"json" }); data2.bind(data1, function(data, filter){ if (filter) return data.id == filter.id; }); grid1.attachEvent("onRowSelect", function(id){ data1.setCursor(id); }); grid1.sync(data1); grid2.sync(data2);
var data1 = new dhtmlXDataStore({ url:"../data/data1.json", datatype:"json" }); var data2 = new dhtmlXDataStore({ dataFeed:"../data/json.php", datatype:"json" }); data2.bind(data1, function(data, filter){ filter.Package = "Filter by "+data.Package; }); grid1.attachEvent("onSelectStateChanged", function(id){ data1.setCursor(id); }); grid1.sync(data1); grid2.sync(data2);
See also Data Binding in Code Samples.