PDA

View Full Version : [FIXED][3.0RC1.1] TreePanel's with frame=true



boxorox
7 May 2009, 3:48 PM
When a Ext.tree.TreePanel is configured with the frame property set to true, the panel gets the normal blue background but the tree is rendered with a white background.

This is caused because ext-all.css (line: 5814) defines the following.


.x-tree .x-panel-body {
background-color: #FFFFFF;
}
But this seems unnecessary (at least to my armature eyes) because ext-all.css (line: 6353) defines the styling for .x-panel-body w/ background-color #FFFFFF;.

The down side to this is when you add the frame: yes to the TreePanel the style at 5814 overrides the frame background color.

I was able to correct this by adding the following style to my apps css file. But seams to me like the style above is unnecessary.


.x-tree .x-panel-ml .x-panel-body {
background: transparent;
}
Checkout this snippet of code for an example of the effect.


Ext.onReady(function() {

var treeRoot = new Ext.tree.TreeNode({
expanded: true,
text: 'Root Node'
});

treeRoot.appendChild([
new Ext.tree.TreeNode({text: 'Child 1', leaf: true}),
new Ext.tree.TreeNode({text: 'Child 2', leaf: true}),
new Ext.tree.TreeNode({text: 'Child 3', leaf: true}),
new Ext.tree.TreeNode({text: 'Child 4', leaf: true})
]);

var panel = new Ext.tree.TreePanel({
applyTo: 'demo',
title: 'Framed TreePanel',
width: 200,
autoHeight: 'true',
frame: true,
root: treeRoot
});
});

evant
7 May 2009, 5:08 PM
Agreed, this style appears to be redundant. Fixed in SVN.

mystix
8 May 2009, 1:29 AM
this fix needs to be applied to the 2.x branch as well.