gijgo icon indicating copy to clipboard operation
gijgo copied to clipboard

Tree Loaded or Tree Ready Event

Open herosp opened this issue 5 years ago • 0 comments

Hi. First at all, thank you for these components, they are really useful.

Is there any way to know if the tree and all of its nodes are completely loaded? I need to check certain nodes ONLY after the tree is completely loaded with all of its nodes expanded (in the same method, i.e., when the page loads). As far as I see, the dataBound event ocurrs before the nodeDataBound event and therefore dataBound does not mean the tree was completely loaded.

I have this code:

    var serviceUrl = myServiceUrl;

    var tree = control.tree({
        primaryKey: 'id',
        dataSource: serviceUrl,
        lazyLoading: true,
        checkboxes: true
        , iconsLibrary: 'materialicons'
        , dataBinding: function (e) {

        }
        , dataBound: function (e) {
            
        }
    });

and just after that I tried:

    var node = tree.getNodeById(the_id);
    tree.check(node);

but node is undefined if the tree is not completely loaded.

Thanks

herosp avatar Apr 14 '20 20:04 herosp