PDA

View Full Version : why does tab still get added



nadeemshafi9
22 Jun 2009, 6:17 AM
hi guys i am trying to prevent a tab from being added to a tab panel, it dosent seem to be working.



if(!Ext.getCmp('managemoviepackagesTabs').getItem(updateMoviePanel.id)){
Ext.getCmp('managemoviepackagesTabs').add(updateMoviePanel);
updateMoviePanel.doLayout();
updateMoviePanel.on('activate', function(n){
updateMoviePanel.doLayout();
});
}
Ext.getCmp('managemoviepackagesTabs').setActiveTab(updateMoviePanel);

koko2589
22 Jun 2009, 8:01 AM
hi guys i am trying to prevent a tab from being added to a tab panel, it dosent seem to be working.



if(!Ext.getCmp('managemoviepackagesTabs').getItem(updateMoviePanel.id)){
Ext.getCmp('managemoviepackagesTabs').add(updateMoviePanel);
updateMoviePanel.doLayout();
updateMoviePanel.on('activate', function(n){
updateMoviePanel.doLayout();
});
}
Ext.getCmp('managemoviepackagesTabs').setActiveTab(updateMoviePanel);


i add tab like this

Tabs = managemoviepackagesTabs
tavlot = updateMoviePanel


handler: function () {
var T = Ext.getCmp('Tabs');
if (!T.findById('tavlot')) {
T.add({
id: 'tavlot',
title: 'tavlot',
iconCls: 'tavlot', // html: 'tavlot',

// html: Ext.get('tavlot').dom.innerHTML+ '</br> '+ desktopMarkup,
closable: true
});
}
T.setActiveTab('tavlot');T.doLayout();
} },'-',{

nadeemshafi9
22 Jun 2009, 10:38 AM
thanks just like you said i done works nice



if(m.length > 0)
{
tab = Ext.getCmp('managemoviepackagesTabs').getComponent('updateMoviePackagePanel_'+m[0].data.id);

if(!tab){
if(m.length > 1) {
Ext.Msg.alert('You must select only 1 record');
return;
}
else if(m.length == 1){
updateMoviePackagePanel = new Ext.Panel({
id: 'updateMoviePackagePanel_'+m[0].data.id,
title: 'Update Movie Package ('+m[0].data.name+')',
width: 555,
height: 800,