PDA

View Full Version : Gridpanel does not show attached store



stoertebeker
29 Apr 2012, 9:42 AM
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:


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:


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:


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.

vietits
29 Apr 2012, 5:31 PM
Let have a try with store2.loadData(store1.getRange()) instead of store2.data=store1.getRange();