Tree Macro events handling

Hi!

How to implement it?
I try this:

$(function () {
    $('#jsTree').on('changed.jstree', function (e, data) {
        console.log(data.node.id);
    });
});

but that doesn’t work.

Thanks.

hi,Try this

require(['jquery', "$!services.webjars.url('org.xwiki.platform:xwiki-platform-tree-webjar', 'require-config.min.js', {'evaluate': true})"], function($) {
   require(['tree'], function($) {

    $('.xtree').on("changed.jstree", function (e, data) {
           console.log(data.node.id);
    });
     
  });
});

I hope to help you.

2 Likes

Magic, but it really works.
Thanks for hint :wink: )