I am using jstree and trying to capture a checkbox state change event. How do I get the currently selected checkbox's state and its list id?
The example that I found here: Jquery Jstree checkbox events capture works but I cannot figure out how to get the node's check state. If there is a better or simpler way, I am open to other suggestions.
$("#demo1").bind("change_state.jstree", function (e, d) {
if ((d.args[0].tagName == "A" || d.args[0].tagName == "INS") &&
(d.inst.data.core.refreshing != true && d.inst.data.core.refreshing != "undefined"))
{
//if a checkbox or it's text was clicked,
//and this is not due to a refresh or initial load, run this code . . .
alert("list id: " +d.rslt.attr("id"));
alert("is item checked?" +"***TODO***");
}
});
Thanks.
**EDIT: I made my question clearer to avoid any confusion about combining plugins (this is not what I'm doing). I have enabled the tree checkboxes within jstree. **