I am using JSTree in my application.
I am unable to implement Search functionality with ajax call.
Here i am putting what i tried.
$(document).ready(function () {
$("#jstree_demo_div").jstree({
"core": {
"data": {
"url": "Tree/Index",
"data": function (node) {
return { "id": node.id };
}
}
},
"search": {
"url": "Tree/Index",
"data": function (node) {
return { "id": node };
}
},
"plugins": ["search"],
});
$('#searchTree').on('click', function (event) {
$("#jstree_demo_div").jstree('search', '1');
});
});
Whenever i press button it comes to event and after that call is not made to server.
What i want is to make ajax call on search and completely recreate treeview as per search.
I am unable to understand how can i do this?
I already checked following link.
jsTree search with Ajax/JSON not calling URL
In above stackoverflow question i am unable to understand what is "json_data" and why and how it is used?
There is not a single example in https://www.jstree.com that uses variable like named "json_data".
Please help me to understand how JSTree Ajax call / Lazy Loading works with search functionality with example.
This is really helpful for me. Thank you in advance.