jquery jstree ajax,jquery - jsTree search with Ajax/JSON not calling URL - Stack Overflow

I would really appreciate some help with the following:

I have a jsTree loaded with JSON data via a URL. All the data is preloaded.

What I need to do is change the search functionality to reload the entire tree with new JSON data via AJAX based on the user input (because I need to do more complex node searching in the backend).

As a start all I am trying to do is to get the jsTree code to call my URL. I started with the same URL as I use to originally load the tree.

However - and this is the problem for which I cannot find a solution - although the URL is called successfully to first load the tree, when I type some search text and click "Search", jsTree uses its normal internal search to highlight nodes, but the URL I provide is never called again.

The HTML is

Search

Clear

The jsTree initialization that I am using is:

var url = ;

$("#myJsTree").jstree({

"json_data" : {

async : true,

"ajax" : {

"url" : url

}

},

"search": {

"case_insensitive" : true,

"ajax" : {

"url" : url

}

},

'ui' : {

'select_limit' : 1,

'initially_selected' : [${myId}],

},

"plugins" : [ "json_data", "search", "sort", "ui", "themeroller" ],

});

And the snippet of search code:

$("#searchTree").click(function() {

$("#myJsTree").jstree("search", $("#treeSearchText").val());

return false;

});

I would really appreciate any help.

Thanks.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值