In the last version (3.0), the API was changed.
If you need just array of selected IDs (like in examples in this node), it is now very easy:
var selectedElmsIds = $('#tree').jstree("get_selected");
If you need to iterate over the selected elements, you just need to pass additional "true" parameter.
var selectedElmsIds = [];
var selectedElms = $('#tree').jstree("get_selected", true);
$.each(selectedElms, function() {
selectedElmsIds.push(this.id);
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…