Jstee中创建节点后就消失了
由厚盒窗口中的函数触发节点创建,创建后节点消失。为什么会发生这种事?这是我的代码清单:
$("#treeDiv").jstree("create",
"#node_133",
"last",
{
"attr" : { "rel" : $("#nodetype option:selected").val().replace("add_","") },
"data" : fratitle
},
function() { alert("added"); },
true
);
Node creation triggered by a function in the thickbox window, after creation the node dissapears. Why could it be happening? Here is my code listing:
$("#treeDiv").jstree("create",
"#node_133",
"last",
{
"attr" : { "rel" : $("#nodetype option:selected").val().replace("add_","") },
"data" : fratitle
},
function() { alert("added"); },
true
);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。数据库表 id 字段没有 auto_increment 属性。因此,当调用回调函数时,r.status 和 r.id 等于 0,回滚函数将树滚动回默认状态,之后树节点消失。
Solved it. Db table id field had no auto_increment attribute. So when callback function were called, r.status and r.id were equal 0 and rollback function were rolling tree back to it's default state and tree node were disappearing after that.