下面是我在jsfiddle.net上发现并改进的代码,用于根据来自
jsTree Get new node AFTER node is created
:
$('#jstree').jstree({
"core" : {
"check_callback" : true,
"data" : ["Root"]
}
});
$('#jstree').on('rename_node.jstree', function (e, data) {
//data.text is the new name:
console.log(data.text);
//MAKE AJAX CALL HERE
});
$('button').click(function () {
$("#jstree").jstree("create_node", null, null, "last", function (node) {
this.edit(node);
});
});
链接:
http://jsfiddle.net/DGAF4/5244/