i have a jstree configure with crrm and context menu plugin.
In the context menu i am configuring the rename menu item
function customMenu(node) {
// The default set of all items
var items = {
renameItem: { // The "rename" menu item
label: "Rename",
action: function ()
{
$("#CompanyTree").jstree("rename");
}
}
};
return items;
}
i bound the rename_node to the jstree
}).bind('rename_node.jstree', function (e, data)
{
//
var newname = data.rslt.name;
if i click on the tree node (select the node first) and then right click and select rename context menu rename working fine. but if i directly right click on the node and select rename context menu, jstree throwing and js exception in the crrm plugin section. because obj is set to false. please help
_fn : {
_show_input : function (obj, callback) {
obj = this._get_node(obj);
var rtl = this._get_settings().core.rtl,
w = this._get_settings().crrm.input_width_limit,
w1 = obj.children("ins").width(),
w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length,
t = this.get_text(obj),
h1 = $("
i have a jstree configure with crrm and context menu plugin.
In the context menu i am configuring the rename menu item
function customMenu(node) { // The default set of all items var items = { renameItem: { // The "rename" menu item label: "Rename", action: function () { $("#CompanyTree").jstree("rename"); } } }; return items; }
i bound the rename_node to the jstree
}).bind('rename_node.jstree', function (e, data) { // var newname = data.rslt.name;
if i click on the tree node (select the node first) and then right click and select rename context menu rename working fine. but if i directly right click on the node and select rename context menu, jstree throwing and js exception in the crrm plugin section. because obj is set to false. please help
_fn : { _show_input : function (obj, callback) { obj = this._get_node(obj); var rtl = this._get_settings().core.rtl, w = this._get_settings().crrm.input_width_limit, w1 = obj.children("ins").width(), w2 = obj.find("> a:visible > ins").width() * obj.find("> a:visible > ins").length, t = this.get_text(obj), h1 = $("
You need to pass a second argument, as you can see here: http://www.jstree.com/documentation/contextmenu
Use:
"action" : function (obj) { this.rename(obj); }
Or:"action" : function (obj) { $("#CompanyTree").jstree("rename", obj); }