views:

39

answers:

1

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(function() {
    $("#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?

A: 

Solved it. I found that class.tree.php has no method that updates type in the database.

Igor