I linked up a few components List -> DataCollection -> Proxy to enable offline mode.
I have scenarios to refresh the data by calling the server url.
How can I achieve that? I tried different method like refreshing DataCollection or the list, with no luck, eg.
subsChannelStore.load(baseUrl + "/mobile/channels/subscribed",
function () {
subsChannelStore.refresh();
$$(“subsChannelList”).refresh();
});
my initialization is below:
var subsChannelSource = new dhx.proxy({
url: baseUrl + "/mobile/channels/subscribed",
storage: dhx.storage.local
});
var subsChannelStore = new dhx.DataCollection({
datatype:"json",
url:subsChannelSource,
});
The initial data loading to local storage, data collection and list are perfectly fine. But now I want to refresh the data with new data from server. How can I do that?
Hi,
when load method will be called the next time and server will be available then actual data will be loaded into datastore and added into local storage.
So the correct scenario is:
-datastore initialized
-data from server side is loaded via proxy
-data is added into local storage
-data is added into datastore
Data refreshes local storage each time when it’s loaded.
When data from server is not available then proxy restores last dataset from local storage.