PDA

View Full Version : Tabpanel with Grids



boonkerz
23 Jun 2010, 4:57 PM
Hello,

I have Tabpanel with Grids when i restore the sate then Toolbar and Store is not shown.
Only in last added Tab it works.

http://img2.pict.com/de/95/f8/3712160/0/1277340967.jpg

wm003
24 Jun 2010, 2:23 AM
check, if you assigned them the same id's on each grid by accident

boonkerz
24 Jun 2010, 3:53 AM
I have an ID for every grid.


Ext.each(this.currentTabs, function(tab) {
this.items.push(new DocPanel({
id: tab.id,
cclass : tab.cclass,
autoLoad: tab.autoLoad,
iconCls: tab.icon,
autoScroll: true
}));
//this.setActiveTab(p);
}, this);


this is my code how i push the state items.

Autoload is like:



url: hreff,
loadScripts: true,
scripts: true

Animal
24 Jun 2010, 4:17 AM
autoLoad?

Show the stuff you are "auto loading".

boonkerz
24 Jun 2010, 4:28 AM
Ok autoload results in an html snipped:



<div id="articlelist"></div><script type="text/javascript" src="/scripts/admin/article/index.js"></script>


And the Grid:


PrintShopCreator.Admin.Article.LIST = Ext.extend(Ext.grid.GridPanel, {

border:false
,layout: 'fit'
,stateful:true
,url:'/admin/article/all?config=1&sid=' + sid
,objName:'article'
,idName:'id'
,stripeRows: true
,frame: false
,autoHeight: true
,autoWidth: true
,id: 'articlegrid'
,initComponent:function() {

.
.
.

}); // eo extend

// register xtype
Ext.reg('PrintShopCreatorAdminArticleLIST', PrintShopCreator.Admin.Article.LIST);
Ext.QuickTips.init();

var articleList = new Ext.Panel({

renderTo: 'articlelist',
id: 'articleList',
closable: false,
resizable: false,
layout: 'fit',
border: true,
items:[{xtype:'PrintShopCreatorAdminArticleLIST', id:'PrintShopCreatorAdminArticleLIST'}]
});
articleList.show();


i have tested with id with no id with renderTo or nothing.

When i add the tabpanel items manually it works. I think the tabpanel is not active when the grid is render.
is this the problem?

Animal
24 Jun 2010, 4:36 AM
Augh!

What's the point in all of that?

Isn't it just a painful, and bug ridden way of diong



var newTab = this.currentTabs.add({xtype:'PrintShopCreatorAdminArticleLIST', id:'PrintShopCreatorAdminArticleLIST'})
this.currentTabs.setActiveTab(newTab);


????

boonkerz
24 Jun 2010, 6:05 AM
What i do is:


I use Ajax Tabitems like:
http://www.sencha.com/deploy/dev/examples/tabs/tabs.html

And in the ajax response i use the grid.

Thx for your help can i spend an amazon Book :)

Animal
24 Jun 2010, 6:07 AM
What i do is:


I use Ajax Tabitems like:
http://www.sencha.com/deploy/dev/examples/tabs/tabs.html



Why?

boonkerz
24 Jun 2010, 1:54 PM
Hello,

I have found my Problem:

deferredRender: false

Why i have use this. no idea :D