irfan
20 Sep 2007, 12:08 AM
Helo, I'd like to know how to limitting tabs that can be added to a contentPanel?
For example: I have a contentPanel that only allowed 10 tabs. If more tab is added then it shows a warning message that the number of allowed tabs are reached and the user have to close some tabs.
code example of tab addition:
function OpenNewTab(tabTitle, link) {
Ext.onReady(function() {
var center = parent.kampiunApp.ui.layout.getRegion('center');
var iframe = Ext.DomHelper.append(parent.document.body, {tag: 'iframe', frameBorder: 0, src: link});
if (parent.tabCounter && parent.tabCounter <parent.tabLimit) //the code to limit tab.
parent.tabCounter++;
//alert(parent.tabCounter);
//if (!center.autoScroll)
// center.autoScroll = true;
//alert (center.);
panel= new Ext.ContentPanel(iframe, {title: Ext.util.Format.ellipsis(tabTitle,20), fitToFrame: true, autoScroll: true, closable: true});
panel.addEvents(
);
parent.kampiunApp.ui.layout.add('center', panel);
center.showPanel(panel)
});
}
Thanks.
For example: I have a contentPanel that only allowed 10 tabs. If more tab is added then it shows a warning message that the number of allowed tabs are reached and the user have to close some tabs.
code example of tab addition:
function OpenNewTab(tabTitle, link) {
Ext.onReady(function() {
var center = parent.kampiunApp.ui.layout.getRegion('center');
var iframe = Ext.DomHelper.append(parent.document.body, {tag: 'iframe', frameBorder: 0, src: link});
if (parent.tabCounter && parent.tabCounter <parent.tabLimit) //the code to limit tab.
parent.tabCounter++;
//alert(parent.tabCounter);
//if (!center.autoScroll)
// center.autoScroll = true;
//alert (center.);
panel= new Ext.ContentPanel(iframe, {title: Ext.util.Format.ellipsis(tabTitle,20), fitToFrame: true, autoScroll: true, closable: true});
panel.addEvents(
);
parent.kampiunApp.ui.layout.add('center', panel);
center.showPanel(panel)
});
}
Thanks.