1 person found this helpful
Did you implement your own custom cellRenderer that has CheckBox components?
If so you'd just be iterating over all the data in the tree looking for any CheckBox components selected state set to true (the cell should report it isSelected as well, the checkbox is more of a visual aid than anything). For you to have multiple selections you'll of course need to enable multipleSelection.
If you have some code that isn't working for you feel free to post a snippit.
Hi Sinious ,
Thanks for your answer ! Let me explain further more ! I need something like this control in VS.net
I added a checkbox on stage and converted it to Movie clip and set it's Linkage to "ch"
then i set tree.cellRender = "ch"
Every leaves had their checkBoxes ! But i don't know how i could find out which items are selected !
If i can't do this i would rather make my project in VS.net ! Please Help me !
If C# (or whatever language that is) has the component you want and you only need to develop your app for windows (not the web, devices, etc) I'd suggest just going with that product if you know how to use it.
There already is a partial CellRenderer class that can help you. If you look in the folder location the following CellRenderer API link mentions you will find a cell renderer named "CheckCellRenderer".Here's the location on Win7:
Make sure you change the portions in bold/italic. The user you're currently on and if you have it set to a different language then choose the folder with the language you use.
Here's some information on the requirements to develop a class that meets the requirements of being a CellRenderer:
The Tree control extends the List control. The List control class should be understood as well:
If you pointed the cellRenderer at the CheckBox component and it works then that class implements all the necessary functions mentioned above already. That only leaves traversing the Tree control which would be required.
Are you asking how to traverse the Tree control? The Tree control itself has the methods you'll need to do it and it's exactly like traversing XML. You can just get the XML out of the Tree control with var treeXML:XML = tree.getTreeNodeAt(0). Use the available methods in a recursive way to traverse it locating each branch and check if it's selected. It's up to you to save the path to each checked item or save a list of checked items in any way you wish (an array, object, etc).