我正在尝试将搜索功能添加到jstree但是给我一个错误:undefined is not a function
$('#tree_').jstree({
'core': {
'check_callback': true,
"themes": {
"responsive": false
},
'search': {},
'plugins': ["search"],
'data': {
type: "POST",
url: "Explorer.aspx/show",
data: function () { return '{"id":"' + $id+ '"}' },
contentType: "application/json"
}
}
});
var to = false;
$('#tree_search').keyup(function () {
if (to) { clearTimeout(to); }
to = setTimeout(function () {
var v = $('#tree_search').val();
$('#tree_').jstree(true).search(v);
}, 250);
});
首先,我没有添加'search': {},
,但它不能同时工作,每个keyup Uncaught TypeError: undefined is not a function (anonymous function)
都写在控制台中。