TXDataWebDataset and local storage

Hi, there is anyway to get data "online" via TXDataWebDataset and store it in local to access in offline mode ? Referring to clientdataset that have a savetofile and loadfromfile methods

I hope is clear !

1 Like

TXDataWebDataset does a single connection to retrieve data (if you use the Load method) and then keeps everything locally in a "buffer" (JS objects).

It doesn't keep an "open" connection to the server like regular Delphi datasets.

You can access the buffer (internal data) via the Rows property so you can simply access it and save it wherever you want (in browser local storage, for example).

yes can be a good idea... have you a sample to give me ?

As I mentioned, to get the data just read the Rows property:

  CurrentDatasetData := XDataWebDataset1.Rows;
  // Do what you want with CurrentDatasetData