Lazy Loading TreeView is not working

7 posts, 0 answers
  1. Josh
    Josh avatar
    9 posts
    Member since:
    Dec 2012

    Posted 19 Dec 2013 Link to this post

    We are using kendo.all.min.js v2013.3.1119 

    I call out my treeview like so:  <ul data-kendo-role="treeview"
             data-kendo-bind="source: dataSource, events: { select: onSelect }"
             data-kendo-load-on-demand="true"
             data-kendo-text-field="name"></ul>


    self.kendoModel.dataSource = new kendo.data.HierarchicalDataSource({
                    transport: {
    read: {
                            type: "GET",
                            dataType: "json",
                            contentType: "application/json",
                            url: apiUrlHelper.getPath('collections') +  "/"
                        }
                    },
                    schema: {
                        model: {
                            id:"id",
                            children   : "items",
                            hasChildren: true
                        }
                    }
                });

    When I first load the page, I get the roots of all items in the tree, and when I click on the expander the class changes on the html element, but I don't see any new requests to the server for additional information. 

    I've tried adding a custom transport and a parameter map, but it's not helping.

    Here's a sample of the json used to populate the tree:

    [{"id":192,"name":"a new collection","customerId":1,"createdBy":"admin","lastModifiedDate":null,"createdDate":"2013-12-17","isprivate":1,"managers":[],"items":[]},{"id":1986,"name":null,"customerId":1,"createdBy":"admin","lastModifiedDate":null,"createdDate":"2013-12-18","isprivate":1,"managers":[],"items":[]}]


  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 20 Dec 2013 Link to this post

    Hello Josh,

    Instantiate the treeview from a div element rather than a ul element. Here's a jsbin that shows this. An empty UL overrides the dataSource declaration at this 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
  4. Josh
    Josh avatar
    9 posts
    Member since:
    Dec 2012

    Posted 20 Dec 2013 Link to this post

    Actually, I had tried it with both a div and a ul.

    It started working when I removed children   : "items" from my schema model. 
  5. Yevgeniy
    Yevgeniy avatar
    2 posts
    Member since:
    Jul 2014

    Posted 24 Jul 2014 Link to this post

    Hello, i have exactly same issue. i am calling web api rest srv in read. 
    Josh please let me know if you have solved this.

    Thank you!
  6. Yevgeniy
    Yevgeniy avatar
    2 posts
    Member since:
    Jul 2014

    Posted 24 Jul 2014 Link to this post

    I have exactly the same issue. calling api using Web api, hasChildren: true, but displays only root level with out expand arrow, and double click does nothing, not making ajax call with ?queryString as an id.
  7. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 28 Jul 2014 Link to this post

    Hello,

    We would need some sample code which replicates the issue. You can attach a runnable project to this forum thread or start a new support ticket if you don't want to disclose private information.

    Regards,
    Atanas Korchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  8. Chris
    Chris avatar
    16 posts
    Member since:
    Mar 2007

    Posted 03 Jun Link to this post

    Confirming that removing the children tag from the schema model worked for me.
Back to Top
Kendo UI is VS 2017 Ready