I have xml file displayed in jstree. I can select node with the following code:
selectNodeEvents = function (data) {
var ready = false;
$("#jstree").bind("reselect.jstree", function () {
var selectedNode = $.cookies.get('mySelectedNode');
jQuery("#jstree").jstree("select_node", selectedNode);
ready = true;
})
.bind("select_node.jstree", function (event, data) {
alert(data.inst.get_text(data.rslt.obj));
})
}
I tried adding the jstree demo code for remove tree node but, I don't think I understand how to go about it. Can someone guide me how to go about this?
.bind("remove.jstree", function (e, data) {
data.rslt.obj.each(function () {
$.ajax({
async: false,
type: 'POST',
url: "/static/v.1.0pre/_demo/server.php",
data: {
"operation": "remove_node",
"id": this.id.replace("node_", "")
},
success: function (r) {
if (!r.status) {
data.inst.refresh();
}
}
});
});
})