jsTree 重命名不起作用
我将 jstree 与 crrm 和 json_data 插件一起使用。当我尝试在节点上调用重命名函数时,出现错误 obj.trigger 不是函数。
我的代码:
//definiton of tree
$('selector').jstree({
//config for tree themes plugin
'themes' : {
'theme' : 'classic',
'dots' : true,
'icons' : true
},
//config for tree json_data plugin
json_data : {
ajax : {
url: '?',
type: 'POST',
dataType: 'json',
beforeSend: function( xhr, s ){
xhr.setRequestHeader("Accept", "text/x-json");
},
context: this,
data: $.proxy(this,'_generateTreeJSONData'),
success: $.proxy(this,'_onTreeLoad'),
error: $.proxy(this,'_onTreeError')
}
},
//config for tree drag and drop plugin
dnd:{
drop_finish: $.proxy(this,'_onTreeDropFinish'),
drag_finish: $.proxy(this,'_onTreeDragFinish'),
drop_check: $.proxy(this,'_onTreeDropCheck'),
drag_check: $.proxy(this,'_onTreeDragCheck'),
drop_target: false,
drag_target: false
},
//config for tree creating renaming removing moving (crrm) plugin
crrm:{
move:{
check_move: $.proxy(this,'_onTreeMoveCheck')
}
},
plugins : ['themes','json_data','ui','dnd','crrm','contextmenu']
});
//conect to click of tree node
$(".ep-acb-tree a").live("click", $.proxy(this,'_onClickTreeNode'));
_onClickTreeNode: function(evt){
$('selector').jstree('rename',evt.currentTarget);
},
这只是我的代码的一部分,但是拖放和其他一切都工作正常。
感谢您的帮助。 本
i'm using jstree with the crrm and the json_data plugin. When I try to call the rename function on a node a get an error obj.trigger is not a function.
my code:
//definiton of tree
$('selector').jstree({
//config for tree themes plugin
'themes' : {
'theme' : 'classic',
'dots' : true,
'icons' : true
},
//config for tree json_data plugin
json_data : {
ajax : {
url: '?',
type: 'POST',
dataType: 'json',
beforeSend: function( xhr, s ){
xhr.setRequestHeader("Accept", "text/x-json");
},
context: this,
data: $.proxy(this,'_generateTreeJSONData'),
success: $.proxy(this,'_onTreeLoad'),
error: $.proxy(this,'_onTreeError')
}
},
//config for tree drag and drop plugin
dnd:{
drop_finish: $.proxy(this,'_onTreeDropFinish'),
drag_finish: $.proxy(this,'_onTreeDragFinish'),
drop_check: $.proxy(this,'_onTreeDropCheck'),
drag_check: $.proxy(this,'_onTreeDragCheck'),
drop_target: false,
drag_target: false
},
//config for tree creating renaming removing moving (crrm) plugin
crrm:{
move:{
check_move: $.proxy(this,'_onTreeMoveCheck')
}
},
plugins : ['themes','json_data','ui','dnd','crrm','contextmenu']
});
//conect to click of tree node
$(".ep-acb-tree a").live("click", $.proxy(this,'_onClickTreeNode'));
_onClickTreeNode: function(evt){
$('selector').jstree('rename',evt.currentTarget);
},
This is only a part of my code but drag and drop and everything else is working fine.
Thanks for your help.
Ben
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过像这样绑定到
rename_node
:Have you tried binding to the
rename_node
like so: