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
answered on 19 Apr 2017, 02:01 PM
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.
Onthe 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.