Hi,
I have a following contextmenu action:
items = {
"addDo": { "label": "Add Do",
"action": function (node) {
$.ajax({
type: 'POST',
url: '/Conclusion/SaveDo',
data: 'id=' + id,
success: function (data) {
$('#treeview').jstree(true).refresh();
$('#treeview').jstree(true).select_node(data.IdForTree);
}
});
}
}
};
Ajax - call creates new item to data source, which is loaded to jsTree like this:
"core": {
"check_callback": true,
"data":
{
"url": "/Conclusion/GetTreeData",
"type": "POST",
"dataType": "json",
"data": function (node) { return { "id":
node.id }; }
}
}
Tree is updated correctly after the refresh, but node selection is not working.
I would like to select newly created item from the tree without success.
What I'm doing wrong?