sample of jstree ajax call code farm
$("#treenode").jstree({
"core": {
"data": {
"url": url,
"type":"post",
"data": function (node) {
return { "ParentId": node.id };
}
}
},
"search": {
"show_only_matches": true,
ajax: {
"url": url,
"type": "post",
"data": function (str) {
return { "str": str };
}
}
},
"plugins": ["search"],
});
var searching = false;
$('#datasearch').keyup(function () {
if (!searching) {
searching = true;
setTimeout(function () {
searching = false;
var v = $('#datasearch').val();
$("#treenode").jstree(true).search(v);
}, 1000);
}
});