I created a generic service based of a JSON.stringified array stored in a localstorage variable.
Here is the javascript code of my generic service:
Appery.getOffline = Appery.createClass(null, {
init: function(requestOptions) {
this.__requestOptions = $.extend({}, requestOptions);
},
process: function(settings) {
if (this.requestOptions.echo) {
settings.success(this.requestOptions.echo);
} else {
//console.log('Default implementation is used. Please define your own.');
// load JSON data from local storage
var cdata = localStorage.getItem("offline1");
//This is how the content of the local storage looks like
//[{"column1":"1","column2":"10","column3":"100"},{"column1":"2","column2":"20","column3":"200"}]
// pass the JSON to the service, for output mapping
settings.success(JSON.parse(cdata));
}
settings.complete('success');
}
});
Unfortunately the mapping into a list element won't work.
Any ideas on what could solve the problem would be great.
Thank you in advance