I am attempting to set up an instance where, if a parent node is checked then the children are checked and if the parent is unchecked the children should be unchecked.
I assume this is done on the client side.
Can I get some assistance with a script?
Hi Daryl,
You can refer to this thread regarding the matter - http://es.infragistics.com/community/forums/p/53859/313719.aspx.
Let me know if you have any questions.
On this line
function ClickHandler(sender, args) { isChecked = args.get_item().get_row().get_cell(0).get_element().children[0].checked;I get an error message stating that "Microsoft JScript runtime error: Object doesn't support property or method 'get_item'
Did i say I am using templated check boxes?
Sorry for the confusion, I will provide you with the code for WebDataTree shortly.
I'm glad I could help.
Feel free to contact me if you have any further questions.
You sir, Are my hero.
Thanks!
You could achieve such behavior using the following script for NodeChecking client side event:
var checkState = 0;
function WebDataTree1_NodeChecking(sender, eventArgs) {
var node = eventArgs.getNode();
checkState = (node.get_checkState() == 0) ? 1 : 0;
setChildrenCheckState(node);
}
function setChildrenCheckState(parentNode) {
if (parentNode.hasChildren()) {
for (var i = 0; i < parentNode.get_childrenCount(); i++) {
parentNode.get_childNode(i).set_checkState(checkState);
if (parentNode.get_childNode(i).hasChildren()) {
setChildrenCheckState(parentNode.get_childNode(i));
In order for this to work, you should set EnableAutoChecking to false.
Let me know if you have any questions regarding the matter.
Okay, I have given up on this and gone to using the built in check boxes.
Now I need to use autocheck, which works, but, when I click a child I don't want the parent changed. I only want it to work when I click the parent then update all the children.
Could you try what I sent you but wrap it in a webtab? Could that have an effect.