Results 1 to 2 of 2

Thread: Gridpanel does not show attached store

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    90
    Answers
    3

    Default Answered: Gridpanel does not show attached store

    Hi,
    I have a simple gridpanel (2 columns) and it has a store (store1) assigned which data is loaded by assigning data from another (identical) store (store2, which loads its data via model and assigned proxy). I have checked store1 and it is identical and has all the 'records' that store2 has. I have also checked the gridpanel and it has the correct store (store1) assigned. But the gridpanel show no rows. When I switch the gridpanel's store to store2 the data it shown correctly. Any hint or idea?

    Here is some of the code.
    store1:
    Code:
          
          autoLoad: false,      
          storeId: 'Rankings',
          model: 'MyApp.model.Rankings',
          fields: [
            {
              name: 'ranktype',
              type: 'string'
            },
            {
              name: 'userid',
              type: 'string'
            },
            {
              name: 'type',
              type: 'string'
            },
            {
              name: 'name',
              type: 'string'
            },
            {
              name: 'score',
              type: 'int'
            }
    store2:
    Code:
    autoLoad: false,
          storeId: 'TopCombined',
          fields: [
            {
              name: 'ranktype',
              type: 'string'
            },
            {
              name: 'userid',
              type: 'string'
            },
            {
              name: 'type',
              type: 'string'
            },
            {
              name: 'name',
              type: 'string'
            },
            {
              name: 'score',
              type: 'int'
            }
    Loading data from store2 to store1:
    Code:
    var store2 = Ext.data.StoreManager.lookup('Rankings');
    var store1 = Ext.data.StoreManager.lookup('TopCombined');
    
    store2.data=store1.getRange();
    I have also tried to 'refresh' the gridpanel with gridpanel.update(), but nothing happened.

    Thanks for reading.

  2. Let have a try with store2.loadData(store1.getRange()) instead of store2.data=store1.getRange();

  3. #2
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Answers
    347

    Default

    Let have a try with store2.loadData(store1.getRange()) instead of store2.data=store1.getRange();

Posting Permissions

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