flex: move item around in a tree control

Posted by Markus on Stack Overflow See other posts from Stack Overflow or by Markus
Published on 2010-03-09T09:35:11Z Indexed on 2010/03/09 9:36 UTC
Read the original article Hit count: 348

Filed under:
|
|
|

Hi everybody,

I have a tree control and I want to give the user the ability that he can move up and down the element he just selected with a up and a downbutton. The tree gets generated from XML.

I managed to insert the selected item a second time at a other place, with the following code:

var parentXML:XML = XML(containerTree.selectedItem).parent();

var upperItem:XML = topContainer.source[containerTree.selectedIndex-1]; 

parentXML.insertChildBefore(upperItem,XML(containerTree.selectedItem));

but then I have the item there twice in the List. How can I remove to reinsert it?

Thanks for Hints! Markus

© Stack Overflow or respective owner

Related posts about flex

Related posts about tree