Bijay Thapa
Bijay Thapa

Reputation: 380

node id of jstree checkbox

I need to retrieve the id of the node when unchecked. On form submit the below code returns all the id of the selected node

checkbox: {
                real_checkboxes: true,
                two_state: true,
                real_checkboxes_names: function (n) {
                    return [("check_" + (n[0].id)), n[0].id]
                }
            }

But for my need i need the id when the node is unchecked like

}).bind('uncheck_node.jstree',function(e,data){
            {     
                var a=$(e).attr('id');               
                alert(a);
            }
        });

Upvotes: 3

Views: 1396

Answers (1)

Kir
Kir

Reputation: 694

.bind("change_state.jstree", function (e, data) {
    if (data.args[1] == true) {
        var a = $(data.rslt).attr('id');
        alert(a);
    }
})

Upvotes: 2

Related Questions