Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
360
Possible to select node via JavaScript so that SelectionChanging event is triggered?
posted

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

Parents Reply Children
No Data