Vivek Baranwal
Vivek Baranwal

Reputation: 217

jsTree : how can i search with id in jsTree?

In jsTree, I have many node with same name but different id. So, i want to search a node with
id with search plugin.

Please help me to do that. Thanks in advance.

Upvotes: 1

Views: 1752

Answers (2)

Denys_Sh
Denys_Sh

Reputation: 69

at current version (3.3), you can handle results of search with option 'search_callback'

$(element).jstree({
    'search': {
        'search_callback': function(searchValue, node){
            return node.id == searchValue;
        }
});

Upvotes: 1

Teja
Teja

Reputation: 1254

The current jstree version supports only search by node title! It works by pattern matching. There is no way you can use the search plugin to search based on the id unless you write your own!

Upvotes: 0

Related Questions