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

Open specific TreeList node upon page load - one level deep only

6 Answers 346 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 2
Veteran
Roger asked on 26 Dec 2020, 06:00 PM

I would like to be have a particular TreeList node open upon page load when the id of the row/node that I want opened was passed in as a parameter and want only first child row opened.  I have cloned  Expand Selected Nodes Example" in the documentation and started this process at https://dojo.telerik.com/@rswetnam/igOwIcUk/8.  

Any help in figuring out how to complete this so that I am able to pass in the parameter (in this case 2 for condiments) instead of clicking on the node I want to expand would be greatly appreciated.

6 Answers, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 29 Dec 2020, 08:00 AM

Hi Roger,

When using the Kendo UI TreeList, the recommended approach is to use the "expand" method. Find a Dojo sample below that demonstrates how to expand a row, both with a given ID or without an ID:

https://dojo.telerik.com/IKAxoYUY

Is it possible for you to share whether the widget in use is the "TreeView" or "TreeList"? As the ticket is submitted for TreeList and the example that you have shared targets the TreeView.

Looking forward to your reply.

 

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 29 Dec 2020, 11:48 AM
Thanks for your reply Tsvetomir.  My project involves a tree list which has the first level down representing different dates and what I want to have happen is that when the user goes to the page, it immediately opens at the row represented by today's date.   I have cloned your example at My Clone (are you able to see this?)  In this case, the page should open with John Doe expanded to reveal Little Sally Doe.  
0
Accepted
Tsvetomir
Telerik team
answered on 31 Dec 2020, 11:01 AM

Hi Roger,

Thank you for sharing the updated example. 

I have noticed that the element for the TreeList was missing and it was not rendering at all. Also, I have noticed that the expand method is working correctly. However, since the second parent of the item of interest is not expanded, it appears as not hidden.

Apart from the item that you would like to show, you will have to expand all the parent rows. Similarly to the approach here:

https://dojo.telerik.com/OdEleGaM

You can automate this process and dynamically find the parents and expand their respective elements.

 

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 23 Jan 2021, 03:02 PM
Thanks for you help Tsvetomir.  I've adapted your example at https://dojo.telerik.com/@rswetnam/oCOTuruw/21 and it works like a charm for my needs!
0
Roger
Top achievements
Rank 2
Veteran
answered on 25 Jan 2021, 05:40 AM
In working further on this project, I have come across an issue where the TreeList opens properly as resolve here using local data but fails using remote data - thought the latter does populate the treelist properly but does not open and select the branches as prescribed.  I have followed this up with a new issue at https://www.telerik.com/forums/treelist-opens-properly-with-local-datasource-but-not-remote
0
Tsvetomir
Telerik team
answered on 26 Jan 2021, 05:35 PM

Hi Roger,

Thank you for letting me know that you have raised a new forum thread for adjusting the sample with remote data. For your information, it is not mandatory to send a separate notification that you have posted a new message, it will appear automatically in our system and I or any of my colleagues will handle it accordingly.

Nevertheless, I am sharing the updated sample here if anyone lands on this thread:

https://dojo.telerik.com/OrURAFaN

 

Best 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/.

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