View Full Version : GXT 3.0 - expand and collapse events for TreeGrid

21 Dec 2011, 5:32 PM
I can't find any way to intercept expand and collapse events for the TreeGrid... am I missing something or is this just not supported?


23 Dec 2011, 4:38 AM
Have you tried tree.addBeforeExpandHandler(...)?

23 Dec 2011, 3:29 PM
Thanks for the reply, unfortunately I need to use a TreeGrid not a Tree.

Actually, I would happily use a Tree but I also need it to be editable and can't find any way to make an editable Tree.

Seems like a bit of a catch 22, need an editable Tree use a TreeGrid, need to handle expand and collapse use a Tree. Need both...

24 Dec 2011, 12:32 AM
I think you will be able to use a tree for editable items.

Just write your own cell, based Cell<C>, override onBrowserEvent and onRender with the behavior you want and use setCell(yourCell) to set the Cell inside the tree.

I would give this a try.

11 Apr 2012, 6:07 AM
Is there a reason, expand and collapse events are not supported in a TreeGrid? I also miss that feature.

12 Apr 2012, 2:51 PM
TreeGrid now implements HasBeforeCollapseItemHandlers, HasCollapseItemHandlers, HasBeforeExpandItemHandlers, and HasExpandItemHandlers. Changes are in RC2:


13 Apr 2012, 12:38 AM
Wow, that was fast - thanks!