Jstree set_type
I'm binding a set_type method to my jstree instance, and then calling the set_type method when clicking a button. Here's my code:
$("#treeDiv").jstree({..}).bind("set_type.jstree", function(e, data) {
$.post(
"./classes/jstree/_demo/server.php",
{
"operation" : "set_type",
"id" : data.rslt.obj.attr("id").replace("node_",""),
"type" : data.rslt.obj.attr("type")
},
function (r) {
if(!r.status) {
$.jstree.rollback(data.rlbk);
}
}
);
});
$("#settype").click(开发者_StackOverflowfunction() {
$("#treeDiv").jstree("set_type", "block", "#node_663");
});
Type of the icon changes, but the type value dosen't changes in db. What am I doing wrong?
Solved it. I found that class.tree.php has no method that updates type in the database.
精彩评论