Search code examples
jqueryeventspostfancytreejquery-lazyload

Fancytree lazyLoad: post event


I have a Fancytree with the following lazyLoad function:

lazyLoad: function (event, data) {
    data.result = {
        url: "/some/url",
        data: { "Id": data.node.key }
    };
},

I need to perform some actions on the new nodes once the lazy data has loaded and the new nodes have been displayed. Is there a function that allows me to do this? postLazyLoad() or something similar? I would need to hook into data.result to get the keys of the new nodes.

Thanks :)


Solution

  • You are probably looking for the loadChildren event:

     $("#tree").fancytree({
          ...
          loadChildren: function(event, data) {
            ...
          },