开发者

How to Fire tree itemClick event on, setting Tree.selectedItem in Flex3 Air

开发者 https://www.devze.com 2022-12-09 17:06 出处:网络
I am working on Air application,i had a problem开发者_如何学运维 on Tree control. Iam adding nodes for the tree dynamically, while adding nodes to the tree i am setting

I am working on Air application,i had a problem开发者_如何学运维 on Tree control.

Iam adding nodes for the tree dynamically, while adding nodes to the tree i am setting

Tree.selectedItem as present added node. after that i need to fire Tree.itemClick event handler method also.

how can i call event handler method as a common method. in Flex3


You can either call the method like you call any other method (pass null for the argument) or you can call dispatchEvent on the Tree to invoke the event handler automatically.

If the event handler function is added through mxml and is not expecting the event as its argument, or it is added with AS but not actually using the event parameter, you can call it like you call any other function.

private function itemClickHandler(event:ListEvent):void
{
  //code doesn't use event
}
//call it with a null
itemClickHandler(null);

//OR

private function itemClickHandler(event:ListEvent = null):void
{
  //code doesn't use event
}
itemClickHandler();
0

精彩评论

暂无评论...
验证码 换一张
取 消