我正在使用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);
},
这只是我的代码的一部分,但是拖放,其他一切工作正常。
感谢您的帮助。 本
答案 0 :(得分:0)
您是否尝试过绑定到rename_node
,如此:
.bind("rename_node.jstree", function (node, ref) {
// Your code goes here....
});