PDA

View Full Version : changing from GridPanel to DataView in a tab



uzzikie
20 Feb 2008, 10:49 PM
i currently have a tab that is configured as a GridPanel
wondering if the contents of the tab can be changed to that of a DataView

currently this is a snippet of what i have done to add the grid as a tab


var grid = new Ext.grid.GridPanel({
store: store,
cm: cm,
stripeRows: true,
view: view,
id: 'grid' node.id,
title: 'Directory',
border: false,
height:fHeight
});


Ext.getCmp('tabPanel').add({
id: 'dataTab',
title: tabTitle,
closable: true,
autoScroll: true,
items: [grid]
});



this is the new DataView that i wish to reload in the same tab

[CODE]
var tpl = new Ext.XTemplate(
'

Condor
20 Feb 2008, 11:21 PM
Add a layout:'card' to your dataTab. Then you can use:


var dataTab = Ext.getCmp('dataTab');
dataTab.add(album_view);
dataTab.getLayout().setActiveItem(album_view);

ps. Even if you don't use this, your dataTab still needs a layout ('fit' in this case).