PDA

View Full Version : Store is overriden in tabpanel



jovisal1
19 Jun 2012, 2:32 AM
Hi all,

I'm trying to create a tab panel with two grids like this. The only part that i change on each grid is the proxy's url to obtain my records. My problem is that i'm trying to have a filter on each tab but this is only being applied on the store which is created for the second grid (it seems like the first store doesn't matter).


createApp: function(){
var me = this;

Ext.create('Ext.container.Viewport', {
name: 'MyMyGrid',
layout: 'fit',
items:[
{
xtype: 'tabpanel',
region: 'east',
itemId: 'nav-panel',
//title: 'Historia Clínica',
preventHeader: true,
animCollapse: true,
collapsible: true,
split: true,
width: 300, // give east and west regions a width
border: false
}]

});


var grid = me.getController('MyMyGrid.MyMyGridScrCtrl')
.createMyMyGridScr();
grid.id = 'home';

var grid2 = me.getController('MyMyGrid.MyMyGridScrCtrl')
.createMyMyGridScr();
grid2.id = 'home2';


var tabs = Ext.ComponentQuery.query('#nav-panel')[0];
tabs.add(grid);
tabs.setActiveTab(grid);
tabs.add(grid2);
tabs.setActiveTab(grid2);
}


I'm a little bit lost. Any ideas??

Thanks,

scottmartin
21 Jun 2012, 10:09 AM
I would say that you are overriding the instance of your first grid with the 2nd grid.
If you create 1 grid, does it work? If you create 3 tabs, does 1 and 2 not get updated?

Scott.

jovisal1
21 Jun 2012, 10:12 PM
Hi scottmartin (http://www.sencha.com/forum/member.php?165873-scottmartin) and thanks for your reply.

Maybe you are right because when i have only one tab it works perfectly. do you know how can avoid it (i use different id's)?.

scottmartin
22 Jun 2012, 5:23 AM
Avoid using id's at all ... use itemId instead.

Scott.