PDA

View Full Version : [FIXED] TreeGrid node icons



DarekKay
30 Nov 2011, 5:13 AM
Another "not really a bug, but should be fixed, though" issue.

I set my node images like that:

tree.getStyle().setNodeCloseIcon(myResources.joint_minus());
tree.getStyle().setNodeOpenIcon(myResources.joint_plus());

Yes, those icons (+ and -) are added but they don't replace the default ones (gxt triangles are still there):
29698

DarekKay
30 Nov 2011, 5:17 AM
My fault... "node icons are of course the NODE icons, not the JOINT" icons :">

EDIT: is there any way to change those icons? In GXT2 this was no problem. Now those icons are managed by the TreeAppearance - but I can't find any way to set my own TreeAppearance (only GridAppearance)..

Colin Alworth
30 Nov 2011, 6:39 PM
Yes, we do need to expose a way to set the icons (and other appearance details) for the Tree in the TreeGrid on an individual basis, but the theming setup still works - you can still configure the entire application's theme to have a specific appearance impl.

The interface com.sencha.gxt.widget.core.client.tree.Tree.TreeAppearance gets its implementation from these lines in com/sencha/gxt/theme/blue/Blue.gwt.xml:

<replace-with class="com.sencha.gxt.theme.blue.client.tree.BlueTreeAppearance">
<when-type-is class="com.sencha.gxt.widget.core.client.tree.Tree.TreeAppearance" />
</replace-with>
indicating that the class com.sencha.gxt.theme.blue.client.tree.BlueTreeAppearance should be used whenever GWT.create(TreeAppearance.class) is called.

You can add these lines to your own module to point to your own appearance implementation.

We'll update this bug when there is a way to set the specific tree appearance info for the TreeGrid, but in general, you'll want to use this other way, to build your own application specific themes.

darrellmeyer
5 Dec 2011, 11:26 AM
We have added support for joint icons with TreeStyle. So you can change icons the same way you change the node icons. We also added a constructor that allows you to specify a TreeAppearance. Change will go out in next release later this week.

darrellmeyer
12 Dec 2011, 6:55 PM
Fixed in beta 1.