I've seen an example somewhere online showing how to customise the appearance of jstree's right-click context menu (using contextmenu plugin).
For example, allow my users to delete "documents" but not "folders" (by hiding the "delete" option from the context menu …
How can I get the id of the selected node in a jsTree?
function createNewNode() {
alert('test');
var tree = $.tree.reference("#basic_html");
selectedNodeId = xxxxxxxxx; //insert instruction to get id here
tree.create({ data : "New Node Name" }, selectedNodeId);
}
Greetings,
I am using jsTree to generatate my hierarchical data. JsTree is generated as follows:
$(function() {
$("#industries").tree({
data: {
type: "json",
opts: {
url: "/Admin/GetIndustries/"
}
}
});
});
it works find and the jsonresult is something like:
[{"attributes":[],"data":{"title":"Adwokaci, Notariusze","id":"1…