I am trying to capture the name of a newly created node using jstree contextmenu. I can write the name of the parent node that I am adding a new node under (with obj.text ()), however I really need the name of the newly created node.
So, somehow there should be an onChange event that can be raised in the jstree contextmenu that fires after the user presses Enter on the newly created node?
Any ideas? I enclosed the contextmenu code:
}).jstree({ json_data: { data: RBSTreeModel, ajax: { type: "POST", data: function (n) { return { NodeID: n.attr("id").substring(4), Level: n.attr("name").substring(7) }; }, url: function (node) { return "/Audit/GetRequirementsTreeStructure"; }, success: function (new_data) { return new_data; } } }, contextmenu: { items: function($node) { return { createItem : { "label" : "Create New Branch", "action" : function(obj) { this.create(obj); alert(obj.text())}, "_class" : "class" }, renameItem : { "label" : "Rename Branch", "action" : function(obj) { this.rename(obj);} }, deleteItem : { "label" : "Remove Branch", "action" : function(obj) { this.remove(obj); } } }; } }, plugins: ["themes", "json_data", "ui", "crrm", "contextmenu"] });
source share