1

I am using jsTree (http://www.jstree.com/plugins/) with below plugins

 "plugins" : [ "dnd" , "contextmenu" ,"ui" , "types" ,  "search" ,"sort" ]

All plugins are working fine except search.There is no search textbox added above tree to search node.Is there any other dependency to use search in jsTree. Please help.

A_____
  • 364
  • 3
  • 19

1 Answers1

5

Just add in a search box above your tree:

<input id="plugins4_q" type="text" placeholder="search">

Note that you'll also need to monitor the search box for text entry and pass the data to the jstree search function. Example javascript:

var to = false;
  $('#plugins4_q').keyup(function () {
    if(to) { clearTimeout(to); }
    to = setTimeout(function () {
      var v = $('#plugins4_q').val();
      $('#plugins4').jstree('search', v);
    }, 250);
 });
TwiceB
  • 959
  • 7
  • 16