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
525
how to set first node as default selected value in WebDataTree
posted

Hi ,

i m using WebDataTree  to display menu like below

+ First Node

    +first childNode

+ Second Node

   +Second childNode

+ Third Node  

   +Third childNode

from above webdataTree menu how to set "+ First Node" as selected(default selected) when page loads.

thanks

ravi

  • 10685
    Verified Answer
    Offline posted

    Hello Ravi,

     

    In order to select/deselect a node client side, you could get a desired node like

    var tree = $find("WebDataTree1");

    var node = tree.getNode(0);

    and use node.set_selected(true) and node.set_selected(false).

     

    However, if the requirement is to fire the client and server side events of this selection, I suggest calling the _selectNode with the click browser event.

    var tree = $find("WebDataTree1");

    var node = tree.getNode(0);

    tree._selectNode(node, true, "click"); 

     

    I am attaching a sample for your reference. In my application I am handling Initialize client side event of the WebDataTree. In this event I am selecting the first node as the requirement is. In this scenario SelectionChanging , SelectionChanged client side events as well as Selection changed server side events are fired. 

    In order to conditionally select a node Server side, you could reference to the following forum thread:

    http://es.infragistics.com/community/forums/t/48590.aspx

     

    Please let me know how my suggestions work for you!

    WDTSelectNode.zip