title: search jstree nodes using jquery javascript
body: <p>I am using jstree plugin to build my tree. I have a search box in my web page where I need users to be able to search for the jstree nodes.</p>
  
  <pre><code>&lt;fieldset id="search"&gt;
  
      &lt;input type="text" name="search_field" id="search_field" value="" /&gt;
      &lt;button id="search_tree"&gt;Search&lt;/button&gt;
  
    &lt;/fieldset&gt;
  </code></pre>
  
  <p>When clicked on search, jstree nodes should be expanded and if found the nodes should be highlighted. If not found and error to users should be displayed like "not found". My code to expand all the nodes below. Is there an easy way to search all the nodes in jstree?</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
       $(document).ready(function(){
  
           $("#search_tree").click(function () {  
      var value=document.getElementById("search_field").value; 
           $("#tree").jstree("search",value);  
  
       });  
  
       $("#tree").jstree({  
  
  
  
           "xml_data" : {  
  
               "ajax" : {  
  
                   "url" : "jstree.xml" 
  
               },  
  
               "xsl" : "nest"
  
  
           },  
           "themes" : {  
  
               "theme" : "classic",  
  
              "dots" : true,  
  
               "icons" : true 
  
           },  
  
               "search" : {  
  
                   "case_insensitive" : true,  
  
                   "ajax" : {  
  
                       "url" : "jstree.xml" 
  
                   }  
  
               },  
                "plugins" : ["themes", "xml_data", "ui","types", "search"] 
  
           });  
  
  
  
   }); 
  
  &lt;/script&gt;
  </code></pre>
  
  <p>I get this error: </p>
  
  <p>Instances[...]is null or not an object. it is a jstree error. any ideas?</p>