我正在使用jsTree,并且想要获取刚刚创建的节点的名称/值/文本,以便我可以将其传递并存储在数据库中。 我的问题是,启用编辑模式后,我没有办法获取用户输入的值。 我的想法是,如果我只能确定编辑模式是打开还是关闭,那么我可以运行一个函数来获取用户的输入。我在这里包含了创建节点的功能。如何检查jstree中的编辑模式是否打开?是否可以检查它?
任何其他方式来解决这个问题非常感谢。提前致谢。一旦节点名称更改
function demo_create(){
var ref = $('#data').jstree(true),
p_id = sel = ref.get_selected();
console.log("Parent Id: "+p_id);
if(!sel.length) { return false; }
sel = sel[0];
id = sel = ref.create_node(sel, {"type":"file"});
console.log("Newly Created Id: "+id);
if(sel) {
ref.edit(sel);
}
};
@vakata能否请你帮忙吗? – maysensei
@maysensei什么? – maysensei