vakata/jstree — Issue #181: Trying to get a list of checked items on change_state in jstree
Author: thapar
Created: 2012-03-04 07:04:49+00:00
State: open

Using jsTree (pre1.0_fix_1), I would like to obtain a list of `id`'s for all the checked items (or better, a JSON object with `id` AND `text` of each checked item). I will then make an ajax call with this. Additionally, this should happen any time there is a state change of something getting checked or unchecked.

This is what I currently have:

$(function(){

n = $('#colors').jstree({
"plugins": ["themes", "html_data", "checkbox"]
}).bind("change_state.jstree", function(e, data){
console.log($('#colors').jstree('get_selected').attr('id'));
});
});

This is just returning 'colors', from the container's `id`: `

`. I fished around the data object, but didn't find id's for checked nodes in there (perhaps I missed it?)