PDA

View Full Version : toolbar in tabs



TheBigOnion
24 Feb 2010, 8:05 AM
Hello all,
I am trying to put a toolbar in a tab. I need to have a different toolbar in each tab.
If you look at http://examples.extjs.eu/dyntab.html, and click on "Add Grid and activate Tab" and click on "add Form" that is what I ultimately need. I need two tabs, one with a form, and one with a grid, and each of the two tabs having it's own toolbar.

Here's some of my code from my Ext.Panel:


,items:[{
xtype:'tabpanel'
,defaults:{layout:'fit'}
,activeItem:0
,height:400
,width:590
,items: [{
title:'Grid'
,id:'firsttab'
,iconCls:'icon-ok'
,bodyStyle:'padding:10px'
,html:'My Grid Goes Here.'
}
,absoluteForm
]
}]


I don't need help with my grid, but how do I put a toolbar in each tab?

Thanks,
Michael

fay
24 Feb 2010, 8:29 AM
Would you not just configure and add a tbar for your absoluteForm and add one to each of your other TabPanel items?

Quick test. Put this in the \examples\tabs\tabs-adv.js example:


function addTab(){
tabs.add({
// ...
closable:true,
tbar:[{
text:'Test ' + index
}]
}).show();
}

TheBigOnion
24 Feb 2010, 8:41 AM
Thanks! Got it.