This is a migrated thread and some comments may be shown as answers.

Reloading treelist

3 Answers 543 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 13 Mar 2017, 08:55 PM

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

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 15 Mar 2017, 11:52 AM
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 (charts) and form elements.
0
Craig
Top achievements
Rank 1
answered on 28 Mar 2017, 01:59 PM

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.

 

0
Stefan
Telerik team
answered on 30 Mar 2017, 08:29 AM
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 (charts) and form elements.
Tags
TreeList
Asked by
Craig
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Craig
Top achievements
Rank 1
Share this question
or