Hi again,
first and foremost: we're using the 14.1 components with the latest SR :)
I just found out how to select a WebDataTree node via JavaScript (by setting the currentlySelectNode.set_selected(false) and newNode.set_selected(true), even though I wonder why the 'selected' attribute is missing in the CSOM documentation. It took me a while to find ;)). Unfortunately this doesn't trigger the client-side and server-side SelectionChanging/Changed events that we would really need. Is there another way to select a node on the client-side which DOES trigger these events, or is there maybe another way to trigger these events manually?
Background: A user can select a node (single select) in our WebDataTree, and then there is some validation on the client side on SelectionChanging; afterwards, the SelectionChanged handler in the code-behind does the most important work. Now in one very special case we have to cancel the SelectionChanging event, save the information about what node the user was about to click, do some other stuff (involving a postback) and then we would like to "finish" the selection on the node the user wanted to select.
For that I save the information about the node in a hidden field, and on PageLoad I want to select the node and let the events do the rest. But since the events are not triggered, I am at a loss about what to do. Right now I would just show a message telling the user to click on the node again, but that's not very elegant ;)
Thanks for your help in advance!
Johannes
Hello Maya,
since I have to do this on pageLoad, I wonder what event to pass to the _selectNode method? Right now I'm getting the node, then do
myTree._selectNode(myNode, true, null)
and it selects the correct node, but the SelectionChanging client-side handler is still not called after this, nor is the server-side SelectionChanged event. Could the missing event be the reason or doesn't it work this way either?
Thanks,
Hello Johannes,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Best Regards,
Maya Kirova
Developer Support Engineer
Infragistics, Inc.
http://www.infragistics.com/support
Thank you for posting in our forum.
The public API does not have a method for selecting a row that would trigger the related client and server events.
You could however work around that by using a private method called _selectNode(node,value, event).
For example:
var tree = $find("WebDataTree1");
var node = tree.getNode(0);
tree._selectNode(node, true, event);
Make sure you also pass the current browser event on which you’re triggering the method.
Let me know if this would solve your issue.
Developer Support Engineer II
http://ko.infragistics.com/support