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
3790
uncheckedNodes but only root nodes.
posted

I want to use the uncheckedNodes/checkedNodes but I have over 1500 of them and I get a script error. I just need  away to select root nodes. I have about 50 tree's in my display and just want to simulate check each one of the 50.

 nodes = $( this.treeIDMap.igTree( "uncheckedNodes" ) );
             for ( var n = 0; n < nodes.length; n++ )
             {
                this.treeIDMap.igTree( "toggleCheckstate", nodes[n].element);
             }

I sort of need it like findImmediateNodesByText does. Though  this.treeIDMap.igTree( "findImmediateNodesByText", 'e' ) gets many, not all. Is there a wild card?

Parents
No Data
Reply
  • 18204
    Verified Answer
    Offline posted

    Hi seang,

     

    Thanks for posting in our forums!

    What you could do here is use the nodeByIndex method to get all the root nodes of a tree.  You can then call the isChecked method on the node to determine if it is checked or not.

    This way is more efficient than using the uncheckedNodes method in this scenario since uncheckedNodes returns all uncheckedNodes, and not just the root nodes.  When using nodeByIndex, we can just ask for the root nodes of each tree.  You can find more information on this method in our API docs here:

    http://help.infragistics.com/jQuery/2014.1/ui.igtree#methods:nodeByIndex

    I have also attached a sample demonstrating how this can be achieved to check all the unchecked root nodes.

    If you need further assistance with this, please let me know and I will be glad to help.

    igTree - TreeUncheckedRootNodes.zip
Children
No Data