2012-07-30 77 views
3

我需要在未選中時檢索節點的標識。 在表單提交下面的代碼返回所有的ID選擇的節點jstree複選框的節點ID

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

,但對我的需要,我需要的ID,當節點選中喜歡

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

回答

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

感謝名單!很棒! – 2012-07-30 08:15:52

+0

也是一個跟進問題。如何重新檢查這個特定的節點,如警報(a)? – 2012-07-30 08:43:46

+0

解決了它:) 使用$('tr')。jstree('check_node','#id') – 2012-07-30 09:06:54