I have a nicely running implementation of jsTree running on a project of mine. The JSON data is provided by PHP/Ajax. I\'ve run into some trouble while using the search plug
I've figured this out. My problem was that I was returning multiple arrays containing the path to each matched node like this:
Array(
Array('#root', '#child', '#sub-child'),
Array('#root', '#child', '#second-sub')
)
As it turns out, jsTree's search plugin A only expects a single-level array, and B will load all nodes listed in that array, the path order doesn't have to be perfectly accurate like the documentation might suggest.
So instead, in my JSON I'm returning an array containing unique node IDs like this:
Array( '#root', '#child', '#sub-child', '#second-sub' )
...and the search plugin is loading the nodes as expected.
Nothing fancy in the end, but I think the jsTree documentation should be more descriptive on this matter as I've seen others with the same problem and no answers.