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

Checkbox ERROR for loading data from controller

2 Answers 65 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Blair
Top achievements
Rank 1
Blair asked on 04 Jul 2014, 08:10 AM
Hi,

I wrote some codes like this getting the json data from the controller, which is working correctly:

        var data = new kendo.data.HierarchicalDataSource({
            transport: {
                read: {
                    url: "LoadActivityPermissions",
                    dataType: "json"
                }
            },
            schema: {
                model: {
                    id: "id",
                    children: "items"
                }
            }
        });
        $("#treeview").kendoTreeView({
            dataSource: data,
            dataTextField: "text",
            checkboxes: {
                checkChildren: true
            }
       
But for the checkboxes, the result is

when some of the children nodes' checkboxes are checked, the parent checkbox is still left unchecked (which is blank), but it should be like a " - " in the checkbox, which means some of its children are checked.

This happened only when I get the data from the "url" (controller).
 
In the attached shortcut, the checkbox for "RootActivity" should be filled in a " - ", which means some of its children have been checked.

Could anyone help me with this? It's very urgent for me.

Thanks and regards,

Charles























2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 08 Jul 2014, 08:53 AM
Hello Blair,

I am not sure what could be causing this problem and I could not reproduce it on my side. Could you check this example which uses the provided configuration and let me know if the checkboxes are working as expected on your side or if I am missing something?

Regards,
Daniel
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Blair
Top achievements
Rank 1
answered on 08 Jul 2014, 10:55 PM
Hello Daniel,

Yesterday I found the problem. That is because the javascript file I used, "kendo.all.min.js", is an old version. After I updated this file, it is working now.

Thanks and regards,

Charles
Tags
TreeView
Asked by
Blair
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Blair
Top achievements
Rank 1
Share this question
or