PDA

View Full Version : Need help : dynamic append tab !



libertux
26 Nov 2007, 10:57 AM
Hi every body ;) :
i have some thing like this :


var newMenu = [{text:'New Project', iconCls:'newpro', handler:lancher},{text:'New Diagram', iconCls:'newdiag', handler:addNewTab}];

OPD = desktop.createWindow({

id: 'OPDW',
tbar:[{text:'File', menu:newMenu },{text:'Edit'},{text:'View'}],
...
items:[{
region:'south',
...
},{
region:'west',
...
},{
region:'center',
id:'wbtabs',
...
xtype: 'tabpanel',
...
items:[{
id:'sp',
...}]
},{...}]
})


what i need is to access the items of the center region to append a new tab for that i do this :



var addNewTab = function() {
OPDW.wbtabs.add({
title: 'New Tab ',
iconCls: 'tabs',
html: 'Hello'
closable:true
}).show();
};


but i dont succseed to make it work (may be i do a :"> )

help needed
THKS

libertux
26 Nov 2007, 11:13 AM
Found it ;) sorry
it's a post by animal
THKS

26 Nov 2007, 11:20 AM
Just an FYI, you can delete your own posts :)