jsTree asynchronous search - trigger load new nodes

て烟熏妆下的殇ゞ 提交于 2019-11-29 11:54:40

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!