jsTree onSelect event

前端 未结 5 717
栀梦
栀梦 2021-02-18 20:39

I\'ve been trying to get the text of a node that is selected in a jsTree. I am able to populate the tree and trigger the onSelect event, but I can\'t find out which node was cli

5条回答
  •  伪装坚强ぢ
    2021-02-18 21:25

    The click event doesn't pass any data with it, so the event object will need to be used.

    .bind("click.jstree", function (event) {
        alert($(event.currentTarget).parent("li:first").text().trim());
    });
    

提交回复
热议问题