TreeView checkbox selection lost on node expand

3 posts, 1 answers
  1. Piyush
    Piyush avatar
    2 posts
    Member since:
    Apr 2015

    Posted 22 Dec 2016 Link to this post

    We are using TreeView which is configured as "loadOnDemand: true" and have checkbox nodes.

    In our use case, we need to progmatically select (ticking) matching nodes (which may be present deep inside the hierarchy).

    When we try to expand the node, having progmatically ticked nodes which have not loaded earlier, the checkbox selection is getting lost.

    http://dojo.telerik.com/@ksingh269/EtaQE

    In the above example, on selection of node "Kendo UI Project", another node "Reports>February.pdf" is progmatically ticked. Now when we try to expand node "Reports", the selection is lost.

    We are upgrading version from 2015.1 318 to 2016.3.1118 and our project gone through regression cycle. Won;t be possible to move to new build.

    Please suggest work around.

    I appears to have lost behavior at 2015.3.1111.

  2. Answer
    Alex Gyoshev
    Admin
    Alex Gyoshev avatar
    2512 posts

    Posted 22 Dec 2016 Link to this post

    Hello Piyush,

    The problem appears to be in the expectation that the fetching of subnodes happens synchronously. The dataSource fetch() is not guaranteed to happen so (especially in the future, with jQuery 3). A cleaner approach is to call the Node.load method to load the subnodes, and use its promise to iterate subnodes. See this Dojo snippet.

    Regards,
    Alex Gyoshev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Piyush
    Piyush avatar
    2 posts
    Member since:
    Apr 2015

    Posted 22 Dec 2016 in reply to Alex Gyoshev Link to this post

    Hi Alex,

    This make sense. After changing the approach, it works.

    Many Thanks :)

    Regards,

    Piyush

Back to Top