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

TreeView checkboxes with remote hierarchical datasource MVC - Country / Region

1 Answer 196 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Beau
Top achievements
Rank 1
Beau asked on 23 Dec 2013, 06:32 AM
How can I create a treeview layout using checkboxes similar to the example below:

[ ] Country A
        [ ] Region A
                [ ] Territory 1
        [X] Region B
                [X] Territory 2
                [X] Territory 7
[ ] Country B
        [ ] Region C
                [ ] Territory 3
                [ ] Territory 4

I am using the MVC helpers and would like to load the data in one call to the controller i.e. NO on-demand loading.

I've been trying to use the following example: http://demos.kendoui.com/web/treeview/remote-data.html - but I 
don't understand how I should construct the JSON object to include children etc.

Similar post here? - http://www.kendoui.com/forums/kendo-ui-framework/hierarchical-data-source/good-way-to-populate-entire-hierarchical-datasource-with-one-data-call.aspx 

Any examples would be great.

Thanks,
Beau

1 Answer, 1 is accepted

Sort by
0
Accepted
Alex Gyoshev
Telerik team
answered on 23 Dec 2013, 08:08 AM
Hello Beau,

You can either construct and render the TreeView from the server (via the BindTo method, shown in the local data demo), or make an AJAX call and fetch the complete hierarchy, as noted in the linked forum post. The demo that you linked to shows how to do load on demand, which cannot load more than one level at a time.

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