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

Load on Demand = false triggers databound event constantly

1 Answer 334 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Louise
Top achievements
Rank 1
Louise asked on 18 Apr 2017, 04:22 AM
I have an event that needs to fire after the whole tree is rendered. And it needs to be fired only once, but the databound event keeps firing. Is there another event that triggers when the whole tree is fully rendered?

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimitar
Telerik team
answered on 19 Apr 2017, 02:01 PM
Hello Louise,

I am afraid that currently there is no event that is triggered when all the data of the TreeView is loaded.

The dataBound event is triggered each time the dataSource change event is processed. This may happen when nodes are being added, removed or loaded.

On the following Dojo example you will find a custom implementation, which counts the number of nodes that that have nested items, and logs a success message at the end of the last dataBound event triggered. You will notice that loadOnDemand is set to false, which forces the full hierarchy to be loaded at initialization time. First is loaded the TreeView with its root nodes and then the dataBound event is fired for each of the nodes, that has children. 

Keep in mind that the above implementation may need to be adjusted to your specific needs. It also needs to be tested in order to proof that it covers the expected scenarios at your end.

Regards,
Dimitar
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.
Tags
TreeView
Asked by
Louise
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or