PDA

View Full Version : Panels in Tab Panel



vamshigurudu
29 Apr 2011, 2:17 AM
HI,

Can we display panels in tab panel.
I mean i have viewport panels when clicking on particular tab i need to display those viewport panels.
Any example.

Thanks

pmatsumura
29 Apr 2011, 2:58 AM
Check out the tabchange event here (http://dev.sencha.com/deploy/ext-3.3.1/docs/?class=Ext.TabPanel).

vamshigurudu
29 Apr 2011, 5:27 AM
Thanks for the reply but i need viewport portal panels displayed in tab panel

friend
29 Apr 2011, 6:38 AM
When you say 'viewport', are you referring to Ext.Viewport?

vamshigurudu
29 Apr 2011, 8:45 AM
Yes am using Ext.viewport

friend
29 Apr 2011, 9:33 AM
You mention using 'viewport portal panels' in your prior post. I'm not sure what you mean by that.

Your app should have one (and only one) Ext.Viewport with some type of layout ('fit', 'border', etc). So in the Viewport, are you using Ext.ux.Portal?

vamshigurudu
29 Apr 2011, 10:13 AM
Please see my code below

var viewport = new Ext.Viewport({
autoshow:true,
layout:'border',
items:[{
region: 'north',
xtype: 'toolbar'
},{
xtype:'portal',
region:'center',
margins:'35 5 5 0',
renderTo:'Div',
items: [{
//columnWidth:.30,style:'padding:2px 0 2px 2px', .....
}]

}
]
});


new Ext.Toolbar({
renderTo: 'dynamic-tabs',
items: [{
xtype: 'tbbutton',
text: 'fdg',
handler: addTab
},{
xtype: 'tbseparator'
},{
xtype: 'tbbutton',
text: 'Add Content',
menu: [ //menu with submenu items]
},{
xtype: 'tbseparator'
},{
xtype: 'tbbutton',
text: 'asdf',
handler: editTab
}
]
});
var tabs = new Ext.TabPanel({
renderTo:'dynamic-tabs',
activeTab: 0,
resizeTabs:true, // turn on tab resizing
//enableTabScroll:true,
plain:true,
plugins: ['tabtitleedit'],
defaults:{autoScroll: true},
items:[{title:'abcd',id: 1,iconCls: 'tabs',closable:true,listeners: { 'beforeclose': onPanelClose }},{title:'xyz',id: 2,iconCls: 'tabs',closable:true,listeners: { 'beforeclose': onPanelClose }}]


});

friend
29 Apr 2011, 11:36 AM
So you want to be able to dynamically add portlets to the Portal where each portlet may contain a TabPanel?

The typical Portal config declares one or more columns, then 'portlet' panels are added to each desired column. Each 'portlet' panel can then contain any kind of content you want, e.g. a Grid, TabPanel, etc.

vamshigurudu
29 Apr 2011, 1:02 PM
Yes exactly, when clicking on each tab i want to display the portal panels in different columns.