PDA

View Full Version : Treepanel in panel not showing the tree



dragem
23 Apr 2012, 2:13 AM
does anyone know why this isn't working?


var mainPanel = Ext.create('Ext.panel.Panel', {
id: 'mainPanel',
width: '100%',
height: '100%',
layout: 'border',
collapsible: false,
renderTo: Ext.getBody(),
items: [
{
xtype: 'treepanel',
id:'naviPanel',
tbar: toolbar,
width: 250,
height: '100%',
region: 'west',
collapsible: false,
useArrows: true,
rootVisible: false,
store: naviStore,
multiSelect: true,
singleExpand: true
},{
xtype: 'panel',
id:'contentPanel',
width: 500,
height: '100%',
region: 'center',
collapsible: false
}
]
});

scottmartin
23 Apr 2012, 8:54 AM
You are not specifying a height for your mainPanel. You are specify '100%' instead of height: 400
If you want a panel the size of your client window, use Viewport.

Viewport automatically renders to body, so there is no need to included that.

Scott.