开发者

Check jstree search result

Can I check if jsTree serach yields some results?

for example, can I do something like that:

var searchResult = $('#m开发者_如何学CyTree').jstree('search', 'keyword');
if(searchResult.haveResults){
   Do something...
};


Finally I found some solution:

var searchResult = $('#myTree').jstree('search', 'keyword');
if ($(searchResult).find('.jstree-search').length == 0) {
   //Do something...
};

.jstree-search is the css class which stick to results nodes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜