Hi,
I'm writing a custom tree renderer to include a checkbox for each
tree node. I want to code inside the renderer itself so that when a
node's checkbox is selected, all the children's checkboxes should
also be selected. It looks something like this:
override protected function createChildren ()
{
...
checkbox = new CheckBox();
checkbox.addEventListener (MouseEvent.CLICK, handleClick);
...
}
private function handleClick (event:MouseEvent)
{
var checked:Boolean = checkbox.selected;
processClick (this, checked);
}
private function processClick (currRenderer, checked)
{
foreach child {
processClick (currRenderer.child, checked);
}
}
The problem is i'm not sure what to be passed to processClick(). I'm
looking for a some variables that let me traverse from that node down
to all the child. In Flex 1.5, you can use "item" which is the
current node. Is there a similar variables in Flex 2?
Thank you
Vu