How can I make jsTree hide non-matching elements, but still display the subnodes of matched elements?
As far as I know there are only two possibilities, that are both not suited for this case. You can either make jsTree hide no element at all by setting
show_only_matches: false
Or you can make it hide all non-matched elements by setting
show_only_matches: true
But this option also hides the subnodes of matched nodes.
Finally, I found the solution, though it doesn’t look really nice, but it works.
Just pass a the found elements the the enableSubtree()-function, and it will show the nodes and take care of the correct appearance (i.e. that the dotted lines are shown and hidden correctly).
A call of this function could look like this:
since all found nodes receive the CSS class .jstree-search.