How do I get the id of the selected node in jsTree?

前端 未结 14 2422
北恋
北恋 2020-12-29 22:38

How can I get the id of the selected node in a jsTree?

function createNewNode() {
  alert(\'test\');
  var tree = $.tree.reference(\"#basic_html\");
  select         


        
14条回答
  •  南笙
    南笙 (楼主)
    2020-12-29 23:16

      $.jstree._reference('#my_tree_container')._get_node(null, true).each(function() {
        id = $(this).attr("id");
        alert('Id selected: ' + id);        
      });
    

提交回复
热议问题