Making datatable data persistent

Hi,

Could somebody please help me with the following problem. I have a multi page GUI designed that uses sockets to send and retrieve data from the server side and into my GUI and its widgets, such as some datatables. Works perfect. I use data in JSON format with the datatable id’s. All looks good.

But, if I load a datatable with data on one page, then navigate away from this page to another page, then navigate back to the page with the datatable, then all data in the datatable are gone. I have not been able to figure out how to make the datatable data persistent once I have populated my table once… could someone please provide a pointer for me on how this should be done. I assume the datatable widgets have some underlying storage area for its data that is not being populated correctly by my code.

Thanks in advance
Johan

from this page to another page, then navigate back to the page with the datatable

Do you mean the real navigation, of just some page reconstruction without real page reloading?

If there is no real page reloading, datatable must preserve data, and may it lost only in next cases

a) direct call grid.clearAll
b) destruction of the datatable view

If you are using something like Webix Jet, datatable will be destructed when it is not visible anymore. Here you can use a bit more complicated solution. Model file may contain DataCollection, which loads the data from the server side, and when you need a Datatable, you can use a DataCollection as source of data.

//in model
var data = new webix.DataCollection({ url: "some.php" });

//in view
webix.ui({ view:"datatable", id:"d1"});
$$("d1").sync(data);