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
840
how to clear the webdata tree nodes on client side
posted

Hi,

I have implemented the webtree view funcationality on the client side. I have done following things

Adding of parents and its childs and its working fine. but the problem is while adding new nodes, previous nodes are not clearing . I did not find clear nodes method in Client Side Api.

Can you let me know how to clear the nodes on client . i want clear the all the nodes from the client side.

Thanks in advance

 

 

  • 49378
    posted

    Hi anilkoomar_1202,

    Thank you for posting in the community.

    Removing individual nodes client-side can be achieved using the remove() function. For instance the first child of the first root can be done using:

    ig_controls.WebDataTree1.getNode(0).get_childNode(0).remove()

    You can "clear" all items from the tree by removind all root nodes. This can be achieved using something similar to:


            function removeAll() {
                while (ig_controls.WebDataTree1.getNodes().get_length() > 0) {
                    ig_controls.WebDataTree1.getNodes().getNode(0).remove();
                }
            }

    Please let me know if this helps.

    • 840
      posted in reply to [Infragistics] Petar Ivanov

      Thanks for your  reply,

      I have got the solution 

       

        function ClearNodes() {

                  currentTree = $find('<%= WebDataTree1.ClientID %>');

                             var tree = currentTree;

                  var nodes = tree.getNodes();

       var len = nodes.get_length();           

                  // Loop Thru Root Items

                  for (var i = len - 1; i > 0; i--) {

                      var node = nodes.getNode(i);

                      tree.remove(node, false); //dispose()

       

                  }

      }

       

       

       

      • 10
        posted in reply to [Infragistics] Petar Ivanov

        Hi

         

        I have one wired requirement please suggest me how can be that done with infragestics

        let us take book and chapter example

        I need to provide the filter to my tree view

        suppose if i am searching with some chapter name xyz ,control should go to that node expand it and mark it with green

        Thanks&Regards,

        Srikanth

        • 49378
          posted in reply to anil kumar

          Hi anilkoomar_1202,

          Please feel free to contact me if you have any further questions.

           

      x An error occurred. Please try again or contact your administrator.