I need to save some data before the user navigates to a new node, hence, I need to bind to the deselect_node.jstree event. My tree is initialized as follows (I omitted some code that does not seem relevant):
var plugins = ["themes", "ui", "contextmenu", "types", "unique"];
var core_config = {
"multiple": false,
"check_callback": true,
'data': function (node, cb) {
cb(SessionService.getModelAsJson());
}
}
treeDiv = $(sourceDiv);
treeDiv
.jstree({
'plugins': plugins,
'types': types_def,
'contextmenu': contextmenu_def,
'core': core_config
})
.bind('loaded.jstree', function (event, data) {
data.instance.select_node(selectNodeId);
defer.resolve();
})
.bind("deselect_node.jstree", function (event, data) {
$log.log("deselect_node.jstree");
})
.bind("select_node.jstree", function (event, data) {
/* cbMap['onNodeSelect'](
SessionService.getSelectedNode(), data.node);*/
});