我一直在查看JStree文档,但我似乎无法让这些按钮永久运行。
请帮助,谢谢。
JSP:
<div col-xs-12 id="button-row4">
<button class="btn btn-success btn-sm" id="delete_node" onclick="demo_create();">
<i class="glyphicon glyphicon-asterisk"></i>
Create
</button>
<button class="btn btn-warning btn-sm" onclick="demo_rename();">
<i class="glyphicon glyphicon-pencil"></i>
Rename
</button>
<button class="btn btn-danger btn-sm" onclick="demo_delete();">
<i class="glyphicon glyphicon-remove"></i>
Delete
</button>
</div>
<div id="jstree_demo_div"> *tree data list* </div>
Jquery:
$("#jstree_demo_div").jstree({
'core': {
'data': coredata
},
'search': {
"case_insensitive": true,
"show_only_matches" : true
},
'plugins': ["search"]
});
$('#jstree_demo_div').on("select_node.jstree",
function(evt, data){
console.log('id '+ JSON.stringify(data.node.id));
console.log('text '+ JSON.stringify(data.node.text));
console.log('li_attr '+ JSON.stringify(data.node.li_attr));
}
);