Flex tree space default event listener -
i have noticed when select tree node if space clicked selected node gets opened... how remove event?
it doesn't there's way prevent event , if there 1 i'm not sure it's wise since tree's keydownhandler little bit more opening node.
i solved creating custom tree. sadly had copy few lines of code tree's keydownhandler.
public class mytree extends tree { override protected function keydownhandler(event:keyboardevent):void { if (event.keycode == keyboard.space) { // code copied tree's keydownhandler // if user has moved caret cursor selected item // move cursor selected item if (caretindex != selectedindex) { // erase caret var renderer:ilistitemrenderer = indextoitemrenderer(caretindex); if (renderer) drawitem(renderer); caretindex = selectedindex; } event.stopimmediatepropagation(); } else { super.keydownhandler(event); } } }
Comments
Post a Comment