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

前端 未结 14 2417
北恋
北恋 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:05

    You can use the following code var nodes = $("#jstree_demo_div").jstree(true).get_selected("full", true);//List of selected node

    nodes[0].id//Which will give id of 1st object from array

提交回复
热议问题