PDA

View Full Version : Tool bar with dynamic tabs and menus



vamshigurudu
21 Mar 2011, 11:15 PM
HI,

I want to add extjs tool bar,dynamic tabs and menus.
Presently i am using viewport in the page, and normal javascript tool bar.
Now i want to change javascript toolbar and menus to extjs toolbar and menus.
Is there any sample example to add toolbar and dynamic tabs to display above viewport.

Thanks

fay
22 Mar 2011, 3:22 AM
This should get you started:



Ext.onReady(function(){
var viewport = new Ext.Viewport({
layout: 'border',
renderTo: document.body,
items: [{
region: 'north',
height: 25,
xtype: 'toolbar',
items: [
{xtype: 'tbbutton', text: 'New tab',
handler: function()
{
var tabs = Ext.getCmp('dynamic-tabs');
tabs.add({
title: 'New Tab',
html: 'Tab Body',
closable:true
}).show();
}
}
]
},{
region: 'center',
xtype: 'tabpanel',
id: 'dynamic-tabs',
items: [
{title: 'test', html: 'asdf'}
]
}
]
});
});

vamshigurudu
28 Mar 2011, 3:15 AM
hi thanks for the reply, is there any chance to ask tab title, while creating new tab.