drumforhim
20 Sep 2012, 4:58 AM
Hello everyone.
I have a problem with adding tabs to a tab panel when i click a menu item. Here is my code
var mainMenuTree = Ext.create('Ext.tree.Panel', {
store: mainMenuTreeStore,
rootVisible: false,
border : false,
bodyPadding : 5,
listeners : {
itemclick : function(view, record, item, index, evt, eOpts) {
var text = record.get('text');
var id = record.internalId;
var leaf = record.data.leaf;
if(leaf === true) {
var newTab = MainUITabPanel.add({
title : text,
id : id,
layout : 'fit',
items : [eval(id)],
closable : true,
border : false,
frame : false
});
MainUITabPanel.setActiveTab(newTab);
}
}
}
});
My problem is that when i click again on the same menu item it adds the same tab to the tab panel. and if i click again it adds it for a third time. is there a config or property i have to enable either to the tab or tab panel!
thank you
I have a problem with adding tabs to a tab panel when i click a menu item. Here is my code
var mainMenuTree = Ext.create('Ext.tree.Panel', {
store: mainMenuTreeStore,
rootVisible: false,
border : false,
bodyPadding : 5,
listeners : {
itemclick : function(view, record, item, index, evt, eOpts) {
var text = record.get('text');
var id = record.internalId;
var leaf = record.data.leaf;
if(leaf === true) {
var newTab = MainUITabPanel.add({
title : text,
id : id,
layout : 'fit',
items : [eval(id)],
closable : true,
border : false,
frame : false
});
MainUITabPanel.setActiveTab(newTab);
}
}
}
});
My problem is that when i click again on the same menu item it adds the same tab to the tab panel. and if i click again it adds it for a third time. is there a config or property i have to enable either to the tab or tab panel!
thank you