PDA

View Full Version : Treepanel inside Tabpanel



Androsx5
26 May 2010, 8:27 AM
Hello to everybody.

I wanna put a treePanel inside a TabPanel as in the example below:





Ext.onReady(function(){

Ext.QuickTips.init();

// This is an inner body element within the Details panel created to provide a "slide in" effect
// on the panel body without affecting the body's box itself. This element is created on
// initial use and cached in this var for subsequent access.
var detailEl;

var cardTabs = {
xtype: 'tabpanel',
id: 'card-tabs-panel',
plain: true, //remove the header border
activeItem: 0,
//defaults: {bodyStyle: 'padding:15px'},
items:[{
title: 'TAB1',
text:"please wait",
contentEl:'tab1',
autoScroll:true
},{
title: 'TAB2',
text:"loading",
autoLoad:'page.php',
autoScroll:true
},{
title: 'TAB 3 - TREEPANEL', <-------- TREEPANEL TO RENDER - NOT WORKING
xtype:'TREEPANEL',
id:'TREEPANEL',
autoScroll:true
}]
};

// This is the main content center region that will contain each example layout panel.
// It will be implemented as a CardLayout since it will contain multiple panels with
// only one being visible at any given time.
var contentPanel = {
id: 'content-panel',
region: 'center', // this is what makes this panel into a region within the containing layout
layout: 'card',
margins: '2 5 5 0',
activeItem: 0,
border: false,
items: [
cardTabs
]
};


new Ext.Viewport({
layout: 'border',
title: 'Project',
items: [{
xtype: 'box',
region: 'north',
applyTo: 'header',
height: 30
},
contentPanel
],
renderTo: Ext.getBody()
});
});






The page returns error and doesn't show treePanel.


The treePanel in a separate file works correctly because it works on a page without panels, so I suppose it is a problem and layout panels.:-?


I would know if someone posted a treePanel inside a TabPanel and please as it did. Could you help me please??

Thank you in advance.