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

TreeList opens properly with local datasource but not remote

2 Answers 95 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 2
Veteran
Roger asked on 25 Jan 2021, 05:36 AM

I have a TreeList that I am able to load with specified branches opened and rows selected using local data.  However, if I access the same data from a remote source, the TreeList populates correctly but none of the specified branches and rows perform as they should.  I have illustrated this problem at https://dojo.telerik.com/@rswetnam/AtILeDOT.

I believe it may have to do with the fact that the remote data is generating a list while the local data is generating an array - but am unable to figure out how to resolve this.  Any help would be greatly appreciated.  

 

nb - this thread follows up on thread https://www.telerik.com/forums/open-specific-treelist-node-upon-page-load---one-level-deep-only which was successfully resolved.

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetomir
Telerik team
answered on 26 Jan 2021, 05:32 PM

Hi Roger,

It is correct that the approach suggested in the other forum thread would work only for local data. This is due to the fact that at the time the widget is instantiated, the data is already present.

However, when the widget is bound to remote data, the widget is first instantiated, and only after that the data is fetched. Effectively, at the time you are expanding the row, the data is not populated.

What I can recommend is that you actually execute the code in the dataBound event of the TreeList. You should set the autoBind property to false, bind the dataBound only once and fetch the data manually.

https://dojo.telerik.com/OrURAFaN

Give this suggestion a try and let me know how it works out for you.

 

Kind regards,
Tsvetomir
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Roger
Top achievements
Rank 2
Veteran
answered on 27 Jan 2021, 03:47 AM
Worked like a charm - thanks!
Tags
TreeList
Asked by
Roger
Top achievements
Rank 2
Veteran
Answers by
Tsvetomir
Telerik team
Roger
Top achievements
Rank 2
Veteran
Share this question
or