PDA

View Full Version : accordion and data store reload



drabslab
23 Dec 2009, 10:51 AM
Could someone please help me with the following.

I have a jsonstore:




var personlist = new Ext.data.JsonStore({
url: 'butler.php',
root: 'rows',
idProperty: 'aypersons_rec_id',
fields: ['aypersons_rec_id','title', 'surname', 'firstname']
});



I have tested this code and it seems to work, at least I am getting the data back from the server in a json file

The problem is that this list of persons is very long and I want to be able to split it in an accordion with the following code



title: 'The new people',
layout: 'accordion',
defaultType: 'grid',
defaults: {
viewConfig: {forceFit: true},
store: personlist,
columns: [
{id: 'aypersons_rec_id', header: 'Title', dataIndex: 'title'},
{id: 'aypersons_rec_id', header: 'Surname', dataIndex: 'surname'},
{id: 'aypersons_rec_id', header: 'Firstname', dataIndex: 'firstname'}
]
},

items: [{
title: 'Cottuli',
init: personlist.load({params:{cdrv:'15', target: '1'}})
},{
title: 'Cumiskey',
init: personlist.load({params:{cdrv:'15', target: '2'}})
},{
title: 'Hinch',
init: personlist.load({params:{cdrv:'15', target: '3'}})
},{
title: 'Mac Cready',
init: personlist.load({params:{cdrv:'15', target: '4'}})
},{
title: 'Moore',
init: personlist.load({params:{cdrv:'15', target: '5'}})
},{
title: 'Napier',
init: personlist.load({params:{cdrv:'15', target: '6'}})
},{
title: 'Other',
init: personlist.load({params:{cdrv:'15', target: '7'}})
}]



This works only partially. I get a list on the screen but once that the store is filled with a list it does not refresh whern I go to another accordion.

I have tried baseParams as well and it gives the same result.

Strangely enough, when I close the session and start all over again It seems random which name (cottuli or hinch or...) that will fill all the accordion screens

A happy new year to all of you

flanders
24 Dec 2009, 3:45 PM
hello drabslab,

Might the reason for every accordion-tab displaying the same info be that you use the same instance of your store every time you load data? I see every init(?) refering to 'personlist'

greetz,

Flanders