View Full Version : localStorage not working in store

10 Aug 2010, 4:24 AM
I followed this thread to create the dataview.


Everything worked.

Here my code

var apptStore = new Ext.data.ArrayStore({
proxy : new Ext.data.MemoryProxy(),
fields : ['clientName', 'apptTime', 'service', 'apptText']
apptStore.loadData([{"clientName": "Evylyn", "apptTime": "10:00 AM", "service": "Womens Hair Cut"},{"clientName":"John Doe", "apptTime": "11:00 AM", "service": "Womens Hair Cut"}]);

new Ext.DataView({
store : apptStore,
tpl : new Ext.XTemplate(
'<tpl for=".">',
'<div class="apptListItem">',
'<div class="ticketList">',
'<p class="ticketListName">{clientName}<span>4:30 PM</span></p>',
'<p>Women\'s Hair Cut</p>',
'<p class="apptLongText">Power is perishable, and when politicians exit the stage, it often doesn\'t take long -- especially in Washington -- for their importance to be only vaguely recollected.</p>',
overClass : 'x-view-over',
itemSelector : 'div.thumb-wrap',
emptyText : 'No images to display'

But when I try to keep the store array in local storage and use


I get this error

Uncaught TypeError: Object [ has no method 'join'

I have no idea what is goin wrong. When I print the 2 arrays they are both showing the same string. Can some one help

10 Aug 2010, 5:52 AM
console.log(typeof localStorage.getItem('apptList5'));

Is it a string?

10 Aug 2010, 7:38 PM
I applied eval and now it works