Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 14, 2008 11:41 AM by mohammedgharieb
Apr 26, 2006 07:37 PM|LINK
if i uncheck level 2 i will get the js error on the line; (matchElement2.checked =
for example: (marked where error occurs)
Apr 26, 2006 10:19 PM|LINK
This routine should work fine on IE and I haven't tested on any other browsers. Try using the tips that others had posted, for multi browser compatibility.
In you case it looks like
getElementsByTagName is returning nothing...
Apr 28, 2006 09:10 AM|LINK
I have tested it and it works fine in IE, Safari, FireFox and even IE 7.0 Beta.
It is level independant, takes care of checking / unchecking for parent / child node checks / unchecks.
If you still face issues, please feel free to post your query.
I would like to thank all of you for the various inputs / suggestions given in this thread and a special thanks to Jake from GeekswithBlogs.com who took the pain to make it work n-level, and posting it in my Blog
May 05, 2006 04:38 PM|LINK
Currently the code was only tested on IE - I guess that with more 30 minutes the code will work on all browsers (I will post it very soon)
Tell me what do you think?
* I was not able to attach it - mail me and I will send it to you :)
// Handle tree view click
var element = event.srcElement;
if (element.tagName == "INPUT" && element.type == "checkbox")
var checkedState = element.checked;
while (element.tagName != "TABLE") // Get wrapping table
element = element.parentElement;
Davidovitz_UnCheckParents(element); // Uncheck all parents
element = element.nextSibling;
if (element == null) // If no childrens than exit
var childTables = element.getElementsByTagName("TABLE");
for (var tableIndex = 0; tableIndex < childTables.length; tableIndex++)
// Uncheck the parents of the given table, Can remove the recurse (redundant)
if (table == null || table.rows.cells.length == 2) // This is the root
var parentTable = table.parentElement.previousSibling;
// Handle the set of checkbox checked state
function Davidovitz_CheckTable(table, checked)
var checkboxIndex = table.rows.cells.length - 1;
var cell = table.rows.cells[checkboxIndex];
var checkboxes = cell.getElementsByTagName("INPUT");
if (checkboxes.length == 1)
checkboxes.checked = checked;
May 06, 2006 01:26 PM|LINK
var TreeNode = event.srcElement ||
if (TreeNode.tagName ==
"INPUT" && TreeNode.type == "checkbox")
I am using the above code to get selected nodes at client side, and it is working fine but the problem is that I want to get Value(TreeNode.Value)
of the current node instead of text(TreeNode.title gives TreeNode.Text), TreeNode.value is always returning ‘on’. Please tell me how I can retrieve Value of the node...
May 07, 2006 06:52 PM|LINK
May 08, 2006 07:38 AM|LINK
Is'nt there any other way I can get the value of the node as I can get its text through title property...[Idea]
or treeview doesent keep nodes value at clientside...
May 10, 2006 04:38 AM|LINK
May 10, 2006 05:00 AM|LINK
Jul 06, 2006 04:10 PM|LINK