Geting all the selected nodes in jstree on check event? : <p>I'm using get_bottom_selected to get all the checked/selected nodes in JSTree. When I setup a button in my form that calls the following method it works. When I try to call the same function from check box click event it does not find any selected nodes, even if there are some.</p>

<pre><code>function testit() {
    var data = $('#my_tree').jstree(true).get_bottom_selected(true);
    for(var count = 0; count &lt; data.length; count++){
        // Do Stuff 
    }
}
</code></pre>

<p>When the following event fires I want to call the function and get all the selected child nodes, but it does not work. Is there something specific to do on this event that works different than calling from a button click event?</p>

<pre><code>.on("check_node.jstree uncheck_node.jstree", function(e, data) {
            testit(); // first line of this function does not get any selected data, even if several are selected. When called from a button click event in my form it does work. 
            });
</code></pre>

<p>Here's how I currently have my jstree setup.</p>

<pre><code>$('#my_tree')
.on("changed.jstree", function (e, data) {
    // Do Stuff
})
.jstree({
checkbox: {
    "keep_selected_style": false,
    "visible" : true,
    "three_state": true,
    "whole_node" : true,
},
plugins: ['checkbox'],
    'core' : {
    'multiple' : true,
    'data' : {
    "url" : "/static/content_data.json",
    "dataType" : "json" 
    }
}
})
.on("check_node.jstree uncheck_node.jstree", function(e, data) {
    testit();
});
</code></pre>
