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
Get all Nodes in javascript of webdatatree
posted

Hi,

 

Can anyone let me know how to get all the nodes in javascript when button click. 

i need the function to get all the node in button click  but get_checkedNodes will be in checked change event of tree view . how can i get the get the checked nodes in treeview without any treeview events.

i have been using the following code but it error is comming,

 

 var nodes = new Array;

 

            var tree = document.getElementById('ctl00_ContentPlaceHolder1_WebTab1_tmpl0_WebDataTree1');

 

            nodes = tree.get_checkedNodes();

 

            var CompGuid = "";

 

            for (var i = 0; i < nodes.length; i++) {

 

                if (nodes[i].get_checkState == 1) {

 

                    //if (CompGuid.length > 0) {

 

                        CompGuid += ",";

 

                    //}

 

                    CompGuid += nodes[i].value;

 

                }

 

            }

 

Thanks in Advance.

Parents Reply Children
No Data