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

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

    In my case, the data call doesnt work. I succeed in accessing my node data by using attr function.

    $("#tree").jstree("get_selected").attr("my-data-name");
    

提交回复
热议问题