PDA

View Full Version : [CLOSED] Add dynamic component in tabpanel in fixed position



Tactem
Dec 07, 2012, 7:55 AM
Hi guys,

i have a tabPanel with component add dynamic with js function.
When i add component, this one is add at the end.

It's possible to add component in second position for example ?

addTabPanel (js)


//Add tab in Tabpanel
function addTabs(type, guid)
{
try {
var index = Ext.getCmp('TabPane').items.length + 1;
var tab = Ext.getCmp('TabPanel').add(
{
id: "Tab" + index,
title: type,
closable: true,
layout: 'fit',
border: false,
loader:
{
url: "../modules/module.aspx?i=" + index + "&g=" + guid,
renderer: "frame"
}
});
Ext.getCmp('TabPanel').setActiveTab(tab);
}
catch (err) {
App.direct.UnhandledException(err);
}
}

Regards

Yoann

Daniil
Dec 07, 2012, 10:40 AM
Hi Yoann,

I think it is possible using the insert method instead of the add one.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.container.AbstractContainer-method-insert

Tactem
Dec 07, 2012, 12:04 PM
thank you very much