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

KendoTreeView CheckBox ClearAll

2 Answers 104 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Rahul
Top achievements
Rank 1
Rahul asked on 06 May 2015, 01:35 PM

 am using KendoTreeView control for hierarchical data. Also I need to provide ClearAll feature where all other fields in form including selections made in KendoTreeView should be cleared. So I have written something like this :

public ClearAll(): void {
        $('#myTreeView').find('input:checkbox').each(function (index,element) {
            $(element).prop('checked', false);
        });
    }

Though this clears all selected checkboxes from treeview, however after this if I check parent node again - child checkboxes does not get checked.Also this behavior (child nodes not getting checked) happens for first time only, so if I uncheck and check parent node again - child nodes will be checked.I simulated sample example for this issue :

http://dojo.telerik.com/@rahul_ec27/ALihu

 

Thanks!! Rahul

2 Answers, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 08 May 2015, 08:15 AM

Hello Rahul,

The approach with the dataItem / set('checked') seen in the dojo snippet is correct. The only problem in the snippet is that the TreeView instance is not retrieved properly -- see the updated snippet.

Regards,
Alex Gyoshev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Rahul
Top achievements
Rank 1
answered on 08 May 2015, 09:32 AM
Thanks a lot Alex !!!
Tags
TreeView
Asked by
Rahul
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Rahul
Top achievements
Rank 1
Share this question
or