PDA

View Full Version : EXT Tree with Complex Nodes



kheraud
21 Jul 2009, 11:59 PM
Hi everybody,

My question is simple : Is it possible to make a Ext.tree.TreePanel with Nodes that are Containers (for example a Column-Layouted Container which represents a checkbox, a label, two images on a single line) ?

I want this feature in order to have a easy, already scripted, complex tree with drags and drops.

If it isn't possible can you give me URL's to begin to extend the Nodes classes ?

Thanks a lot for your help,

Kheraud

Condor
22 Jul 2009, 12:05 AM
This is not standard behavior. The only thing you can do is render components inside the node.ui.textNode after the node is rendered.

(remember that you are responsible for destroying the components when you remove the node, otherwise you get a memory leak)

kheraud
22 Jul 2009, 1:36 AM
Hi,

First of all, thank you very much for the time you took to reply !

I should have said first that I wasn't such an expert. I begin in javascript (but I have a strong experience in C, C#, java, python, perl and php) and in extJS.

The only API I have is the one provided by extJS. I can't find anything about node.ui.textNode. Where can I find infos about this. I understand that the point is to get the text item inside the tree (Node.item), but I know nothing about the items inside ...

Thank to assist my fisrts steps =)

Kheraud

Condor
22 Jul 2009, 1:42 AM
Tree nodes use a UI class (TreeNodeUI) do display themselves. One of the elements of a rendered node is the text element, in which you could render components.

So you could use:

component.render(node.getUI().getTextEl());
(each of these methods is documented in the API docs)

kheraud
22 Jul 2009, 1:50 AM
The key point was the getUI() stuf I am not familiar with.

Thank you very much, I understand everything NOW !

Kheraud