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.
Hi Petar Ivanov,
i have been usoing the following
nodes[i].get_checkState
to get Checked status but is coming as undefined.
Thanks in advance
Hi anilkoomar_1202,
Attached is a sample illustrating the configuration you have requested.
Thanks For your Quick Reply,
can u provide me a sample to get the checked nodes in the webdatatree without using any webdatatree events. i need to get the checked nodes data on button click in javascript
Thank you for posting in the community.
In order to access the WebDataTree object on the client either $find or the ig_controls object can be used. For instance:
var tree = $find('<%= WebDataTree2.ClientID %>'); var tree = ig_controls.ContentPlaceHolder1_WebDataTree2;
var tree = $find('<%= WebDataTree2.ClientID %>');
var tree = ig_controls.ContentPlaceHolder1_WebDataTree2;
Please let me know if this helps.