Load on Demand = false triggers databound event constantly

2 posts, 1 answers
  1. Louise
    Louise avatar
    19 posts
    Member since:
    Nov 2014

    Posted 17 Apr 2017 Link to this post

    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?
  2. Answer
    Dimitar avatar
    812 posts

    Posted 19 Apr 2017 Link to this post

    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.

    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.
Back to Top