HierarchicalDataSource, how to re-fetch data

7 posts, 1 answers
  1. Iwhp
    Iwhp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 14 Aug 2012 Link to this post

    By using a HierarchicalDataSource, the first time a node is expanded, the data is fetch from the data source.
    The next time, the data is not retrieved from the data source.
    How can one define, that on each expand, the data should be fetched from the data source?
  2. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Aug 2012 Link to this post

    Hello Harry,

    Set the loaded flag of the datasource Node to false.

    Regards,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Iwhp
    Iwhp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 14 Aug 2012 Link to this post

    Thankx! I tried the following:

    treeview.bind("expand", function (e) {
        e.node.loaded(false);
    });

    but the .loaded function is not defined here. Are there other options?
  5. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 14 Aug 2012 Link to this post

    Hello Harry,

    The loaded function is part of the HierarchicalDataSource Node object (rather than of the DOM object of the treeview node):

    // get the Node object (model)
    var dataItem = this.dataItem(e.node);
    dataItem.loaded(false);

    Kind regards,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  6. Iwhp
    Iwhp avatar
    40 posts
    Member since:
    Dec 2009

    Posted 14 Aug 2012 Link to this post

    Thankx a lot, it is getting the data now.

    So one small issue remains on my side:

    BUG: the visual indicator, that the data is fetched from the data source, is not shown the second time.
    Workaround: When I collapse the parent above the one which should be fetched and then open the child, then the indicator is shown.
  7. Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2500 posts

    Posted 15 Aug 2012 Link to this post

    Hello Harry,

    We have made some improvements in the next internal build, which should be available in a few hours. Please try it out and see if the bug persists.

    Greetings,
    Alex Gyoshev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  8. Greg
    Greg avatar
    1 posts
    Member since:
    Sep 2012

    Posted 21 Aug 2012 Link to this post

    Finally found what I needed...thank you for this information!
Back to Top
UI for ASP.NET MVC is VS 2017 Ready