Results 1 to 2 of 2

Thread: accordion and data store reload

  1. #1
    Sencha User
    Join Date
    Jul 2008
    Posts
    49

    Default accordion and data store reload

    Could someone please help me with the following.

    I have a jsonstore:

    Code:
     
    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

    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

  2. #2
    Sencha User
    Join Date
    Dec 2009
    Location
    Enschede, The Netherlands
    Posts
    327

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •