This is a migrated thread and some comments may be shown as answers.

Setting checkboxes - "too much recursion" error

1 Answer 108 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 30 Nov 2012, 09:03 PM
Getting a "too much recursion" error when attempting to programmatically uncheck all checkboxes in a treeview. Using this code:
$("#tree-item li span").siblings("span").find(":checkbox").each(function() {
    $(this).prop("checked", false);
    $(this).change();
});

Nothing fancy, or so I thought.

Thoughts, anyone?

1 Answer, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 04 Dec 2012, 05:15 PM
Hi Angelo,

 

You should use the following approach to check all checkboxes under the TreeView:

$("#treeview").find(":checkbox").prop("checked", false);

Also I would suggest using the Set method to update the current records 'IsChecked' property if needed.

Kind Regards,
Vladimir Iliev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
TreeView
Asked by
Mike
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Share this question
or