View Full Version : How to create custom Tree node (node as an extjs component).

24 Mar 2014, 11:44 PM
Hi, i have been using extjs tree for a while and it was fine until now. I need to represent much more information in a node, have it extra buttons, images etc. It probably could be done by inserting custom html code, but why should I bother if I have all these awesome Extjs features.
So the thing I want is that each tree node contains in example an Extjs container which I could use to layout child elements easily - text, buttons, images.

*) How that can be accomplished in the easiest way?

*) Should I use treeview instead of treepanel? I am asking because maybe treepanel is bound to specific size restrictions, so I need to create my own layout rules, but then I could use already available functionality for expand/hide.

*) I tried to create a <div id="yyy"></div> and renderTo an Extjs Panel, but it isn't layed next to icon. And seems like closing/expanding nodes doesn't work so good and then I have to manage resizing manually.

Thank you.

2 Apr 2014, 9:54 AM
Would a 'column' layout work for you? If so you can use a treegrid: http://docs.sencha.com/extjs/4.2.1/#!/example/build/KitchenSink/ext-theme-neptune/#tree-grid