PDA

View Full Version : Problem: 2 Treepanel in a Panel - only first show up



Realnub
4 Jan 2010, 3:45 AM
Hello,

i have a problem with two TreePanel in one Panel (layout: 'accordion'). Only the first Treepanel is shown by default. If i collaps the first, the other TreePanel appears (collapsed).
But I want by default all TreePanel showing up (only first should be expanded).

my Code


var mainmenu = new Ext.Panel({
id: 'mainmenu',
region: 'west',
title: 'Menü',
layout : 'accordion',
width: 170,
margins: {top:0, right:0, bottom:5, left:0},
autoScroll: false,
split: true,
bbar: MenuBottomBar,
items: [{
xtype: 'treepanel',
title: 'TITLE',
id: 'Tree1',
collapsible: true,
autoScroll: true,
loader: new Ext.tree.TreeLoader(),
root: TreeRoot1 = new Ext.tree.AsyncTreeNode({id: 'TreeRoot1', expanded: true, children: []}),
rootVisible: false
},{
xtype: 'treepanel',
title: 'TITLE',
id: 'Tree2',
collapsible: true,
autoScroll: true,
loader: new Ext.tree.TreeLoader(),
root: TreeRoot2 = new Ext.tree.AsyncTreeNode({id: 'TreeRoot2', expanded: false, children: []}),
rootVisible: false
}]
});the children of each TreeNode are added later, e.g.


TreeRoot2.appendChild({
text: 'TEXT',
leaf: true,
qtip: 'TEXT',
listeners: {click: function() {functionxy();} }
});Anyone can help me? thx so far :)

*EDIT* with ext 3.0 it works fine, but ext 3.1 causes this issue.

*EDIT2* Problem solved --> the bbar menue of the panel overlayed the treepanel. .doLayout() solved :)

yogeshmsharma
5 Feb 2010, 5:12 AM
I am facing similar problem.
I have one div and I want to render accordion Panel layout in it .

Panel contains 6 Tree Panels .

When I collapse first Panel and re-expand it ,treePanel inside gets lost And i can't able to expand any panel thereafter.

Example works if we use simple js embed in HTML but it failed when I tried loading it in div

I tried applyTo() , doLayout() but it didn't helped me