This question is locked. New answers and comments are not allowed.
Hi All,
I have a list of saved items in my kendo mobile app which is shown to the user using a listview, the listview is populated by a datsource and i add items to this datasource from different views on the app based on the user clicking save item. What is the best way to save the data on this datasource to be persistant when the user closes and starts the app again ?
should i be using localstorage ? my understanding is that this is treated as cached data and ios does not back it up ? is this the right way to go ?
this is what my datasource looks like so far although i cant get it to fire the create method when i use .add
new kendo.data.DataSource({
transport: {
read: function (options) {
//
options.success(JSON.parse(localStorage.getItem('xxx')));
},
create: function (options) {
alert('test storage create');
localStorage.setItem('xxx',options.data);
}
},
schema: {
model: {
id: "id",
fields: {
id: { type: "string" },
name: { type: "string" },
picurl: { type: "string" },
type: {type: "string"}
}
}
}
}),
Cheers
Niro
I have a list of saved items in my kendo mobile app which is shown to the user using a listview, the listview is populated by a datsource and i add items to this datasource from different views on the app based on the user clicking save item. What is the best way to save the data on this datasource to be persistant when the user closes and starts the app again ?
should i be using localstorage ? my understanding is that this is treated as cached data and ios does not back it up ? is this the right way to go ?
this is what my datasource looks like so far although i cant get it to fire the create method when i use .add
new kendo.data.DataSource({
transport: {
read: function (options) {
//
options.success(JSON.parse(localStorage.getItem('xxx')));
},
create: function (options) {
alert('test storage create');
localStorage.setItem('xxx',options.data);
}
},
schema: {
model: {
id: "id",
fields: {
id: { type: "string" },
name: { type: "string" },
picurl: { type: "string" },
type: {type: "string"}
}
}
}
}),
Cheers
Niro