Tree item edit event listener in flex

Posted by Biroka on Stack Overflow See other posts from Stack Overflow or by Biroka
Published on 2010-03-28T12:40:15Z Indexed on 2010/03/28 12:43 UTC
Read the original article Hit count: 373

Filed under:
|
|
|

I want to catch itemEditEnd in a tree control, but i'm having a little trouble. I call the item editing a bit different:

<mx:Tree id="tree" width="100%" height="100%" 
            itemDoubleClick="treeProjects_itemDoubleClickHandler(event)" 
            doubleClickEnabled="true"
            editable="true"
            itemEditBeginning="treeProjects_itemEditBeginingHandler(event)"
            itemEditEnd="treeProjects_itemEditEndHandler(event)"     
                         >

but:

protected function treeProjects_itemEditBeginingHandler(event:ListEvent):void
            {
                event.preventDefault();
            }

i do this, because I want to edit the field just when clicking rename in the context menu. And when I click rename in the context menu, this is what i'm doing (contextParentItem is the event catched on itemRollOver in the tree) :

Tree( contextParentItem.target ).editedItemPosition = { columnIndex: 0, rowIndex: contextParentItem.rowIndex };

Thisway I can't catch the itemEditEnd event, but I want to handle some stuff, like:

  • if the new entered value is an empty string, then I don't want to accept the new value
  • if I hit ESC then, the old value should remain.

© Stack Overflow or respective owner

Related posts about flex

Related posts about as3