1 Reply Latest reply on Feb 4, 2008 1:53 PM by ntsiii

    Triggering change event in tree automatically

    NateFlex
      I want to simulate a click on a tree item when I get the results of a remote data call. I use treeMy.selectedIndex = 1, to try and select a specific tree item, but all that does is highlight the tree node, nothing else, it doesn't actually fire off any of the other (important) events like change. Is there a way to make it act more like a real click occured, where it will fire off all the appropriate events, as if a user had clicked it?
        • 1. Re: Triggering change event in tree automatically
          ntsiii Level 3
          There probably is, but I avoid this issue by not actually putting the action code in the event handler, but rather in its own method, which I call from the handler. This way I can invoke any functionality I want directly without trying to simulate a user gesture.

          Of course you could always manually dispatch an event, myTree.dispatchEvent(new Event("change");

          Tracy