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
45
WebDataTree Expanding specific node by javascript
posted

Hi,

I hava a question.

I want load WebDataTree , just one node expended ( node will change dynamically )

please tell me, how can I do.

  • 2155
    Offline posted

    Hello Seunggyun,

    Thank you for posting in Infragistics forum.

    You should be able to expand a node on load by calling node’s set_expanded() method at WebDataTree's Initialize event like below.

    Javascript
    ------------------------------
    function WebDataTree1_Initialize(sender, eventArgs)
    {
        if('<%= Page.IsPostBack%>' != 'True')
        {
            sender.getNode(0).set_expanded(true);
            sender.getNode(0).get_childNode(0).set_expanded(true);
        }  
    }
    ------------------------------
    aspx
    ------------------------------
            <ig:WebDataTree ID="WebDataTree1">
    …..
                <ClientEvents Initialize="WebDataTree1_Initialize" />
            </ig:WebDataTree>
    ------------------------------

    I have attached a sample for your reference.

    Please let me know if I may be of further assistance.

    7853.WebApplication1.zip