Hi all,
I'm trying to figure out how to use the local storage for storing some
unchanging data if possible. I first check for the support of the storage
and then attempt to get the model from the offline storage. If it does not
exist I grab it from a Json store. This works but the next time I load the
site I thought the data should now come from the offline store but it is
not. Is there something I am missing here? I can't see a way to 'save' the
json data to the offline store which seems like what is missing.
if (qx.core.Environment.get("html.storage.local"))
{
console.log("local storage exists!");
///use local storage
theStore = new qx.data.store.Offline(url, "local");
if(theStore.getModel() == null)
{
console.log("loading from json data");
var jsonStore = new qx.data.store.Json(url);
theStore.setModel(jsonStore.getModel());
}
else
{
console.log("Local storage! Loaded from cache");
}
}
else
{
console.log("No local storage - loading from json data");
theStore = new qx.data.store.Json(url);
}
--
View this message in context:
http://qooxdoo.678.n2.nabble.com/Using-local-storage-tp7085863p7085863.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Learn Windows Azure Live! Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for
developers. It will provide a great way to learn Windows Azure and what it
provides. You can attend the event by watching it streamed LIVE online.
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel