PDA

View Full Version : The is*Key methods on a TreeGridEvent received in a BeforeExpand event are never true



hulseware
16 Feb 2012, 5:04 AM
When I expand a tree node, I'd like to use one of the modifier keys to signal that I want to fully expand the full subtree instead of just one level at a time. So I have a BeforeExpand listener set up (which I already use to make the server-side call to expand the next level). I printed out the classname of the event I was getting (TreeGridEvent) and started looking at what it supported, and found the isShiftKey, isControlKey and isAltKey methods. However, none of them ever return true.

Is there some place I have to enable this kind of data for the events coming from the tree? Or is this some kind of bug related to BeforeExpand?

I also added an Expand event handler thinking that maybe it wouldn't show up in the BeforeExpand event, but all three methods show up false from there as well.

smiletolead
17 Feb 2012, 6:35 AM
TreeGridEvent is extending from DOMEvent, which has the methods isControlKey(), isAltKey() etc. When firing BeforeExpand event, TreeGrid will not add the details about keys held down to the event object. So the key methods are returning false. I am not sure if it is bug or it is designed this way.

Instead of using special keys, you can use context menus to expand nodes in different ways right?

Regards,
Ganesh