A working example of a search-form for jsTree:
/**
* Insert search-form
*/
$('#your-jstree-id').before(
$('<form id="search"><span></span><input type="text" value=""><input
type="submit" value="search"><input type="reset" value="X"></form>').
bind({
reset: function(evt){
$.jstree._focused().clear_search();
$('#search span').html('');
},
submit: function(evt){
var searchvalue = $('#search input[type="text"]').val();
if(searchvalue!='') {
$('#your-jstree-id').jstree('search', searchvalue);
$('#search span').html('');
} else {
//$.jstree._focused().clear_search();
$('#your-jstree-id').jstree('clear_search');
$('#search span').html('Please enter searchvalue');
}
return false;
}
})
);
This will create the search-form dynamically right before the jstree-
container. In your case your jstree-id will be #mytree and has to be
replaced in the example of course.
Good luck.
Markus.