Hi!
Is it possible to show the small busy indicator from the Treeview when its programmatically expanded like in the following example when double clicked the item
https://stackblitz.com/edit/angular-6n5745?file=app/app.component.ts
3 Answers, 1 is accepted
Hello Michael,
Thank you for the provided example. The loading indicator can be triggered when expanding a node by calling the TreeView expandNode method. What it does internally is that it emits an expand event for the targeted node as if it were triggered by user interaction. Thus the loading indicator is also activated. Here's an example. Notice that I also pass the node index as well - this is required for the loading indicator to kick in.
Also, you can avoid defining a node template just to capture the dblclick event - the TreeView exposes a nodeDblClick event which can be used instead to caputre the event more easily. Here's an updated example.
Let me know if you need further assistance on the topic.
Regards,
Dimitar
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/.
Hi Dimitar,
thx for the reply and the hint with the (nodeDblClick) event - works great.
One more question: is there a way to cache loaded tree items?
Hi Michael,
The TreeView currently doesn't support children caching. Each expand/collapse/expand iteration will trigger the provided children callback for the expanded node.
It can be handled in your code though. The service can be configured to store child nodes when loaded on demand and retrieve the cache when requested again. Here's an example for this. Notice that the app.component is not changed at all - only the service is modified to persist the items once loaded.
As a side note, I'd ask you to open new tickets or forum threads in the future, when you have a question unrelated to the original one. The idea is to keep clean threads where a single problem is resolved. It's much easier to get around for both us and potentially even you. Thanks in advance!
Regards,
Dimitar
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/.