I have certain data saved in the local storage. The same has been saved onto the store. What I require is to extract a particular item from the localstorage and display it. I am not sure how to do that.
For eg:
model.data.servname = servname;
model.data.port = port;
model.data.protocol = protocol;
model.data.username = username;
model.data.password = password;
model.data.domain = domain;
model.data.apptitle = apptitle;
model.data.appconfig = appconfig;
model.save();
var store = Ext.getStore('configStore'); // Get the store
store.add({servname : 'infoimage'}); // Add an instance of you model item
store.sync(); // Will add the item to the locastorage
var item = store.getAt(0);
this part of my code saves the data onto the local storage and the store. Now, in my main controller:
init : function() {
if (!this.landingoverlay) {
this.landingoverlay = Ext.Viewport.add({
xtype : 'landingPageOverlay'
});
}
this.landingoverlay.show();
}
I want to display the apptitle value.
but
console.log(Ext.getCmp('apptitle').getValue());
does not work cause its not yet defined. But the value is there in the local storage. How do i access that value and display it here?
To get data from your store which is configured to use a
localstorageproxy:To iterate through your Store instances and print them:
Hope this helps.