TreeView checkboxes with remote hierarchical datasource MVC - Country / Region

2 posts, 1 answers
  1. Beau
    Beau avatar
    19 posts
    Member since:
    Mar 2011

    Posted 23 Dec 2013 Link to this post

    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
  2. Answer
    Beau
    Beau avatar
    19 posts
    Member since:
    Mar 2011

    Posted 23 Dec 2013 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
Back to Top