Reloading treelist

4 posts, 0 answers
  1. Craig
    Craig avatar
    5 posts
    Member since:
    Jun 2011

    Posted 13 Mar Link to this post

    So when I load the treelist initially it appears fine.  Due to user input I need to clear the treelist and redraw with new data.  My second transport read is happening properly yet my treelist shows completely empty.  It appears that the treelist is not happy with redrawing after everything is databound.

    I call treelistoptions.dataSource.read() and I see it enter transport.read and read successfully then calling options.success(mydata); yet I see no data.  When I destroy my control and re-enter it then appears fine.

     I have tried passing the collection to treelistoptions.dataSource.data(mydata) and have had no luck with that either.

    Thanks

    -Craig

  2. Stefan
    Admin
    Stefan avatar
    1145 posts

    Posted 15 Mar Link to this post

    Hello Craig,

    I was not able to observe the same issue on my end but probably I missed an important step when the data have to be changed.

    Please observe the following example demonstrating how the new data can be used using the data method of the dataSource:

    http://dojo.telerik.com/UkibI

    The other option will be to set directly a new dataSource using the setDataSource method:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/treelist#methods-setDataSource

    Please have in mind that the data have to be with the same field name in order to match the old one.

    Regards,
    Stefan
    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. Craig
    Craig avatar
    5 posts
    Member since:
    Jun 2011

    Posted 28 Mar Link to this post

    FYI,

    I had this treelist control on another tab and attempted to update it from a separate tab.  I found that it would not update if the treelist was not visible.  I would end up with an empty treelist.  When I tried to do the same code from the tab that the treelist control was on then my code worked perfectly fine.  I don't know if this is a known limitation or a 'feature' to not redraw controls that are not visible.

     

  4. Stefan
    Admin
    Stefan avatar
    1145 posts

    Posted 30 Mar Link to this post

    Hello Craig,

    I'm happy to hear that the issue is resolved.

    Still, even if the tab with the TreeList is not displayed the data still should be applied as expected.

    I modified the example to put the TreeList inside a TabStrip and the data is still applied as expected:

    http://dojo.telerik.com/aSUSu

    Regards,
    Stefan
    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.
Back to Top