开发者

jstree search json problem

开发者 https://www.devze.com 2023-04-01 01:06 出处:网络
I am using jstree and it is loading ok with json data, the searching in the parent nodes works fine as well, but when it comes to searching the child nodes which are not loaded at first (as the tree i

I am using jstree and it is loading ok with json data, the searching in the parent nodes works fine as well, but when it comes to searching the child nodes which are not loaded at first (as the tree is big and children are only loaded wh开发者_JS百科en a parent is selected) I am experiencing a problem.

the jstree documentation http://www.jstree.com/documentation/search says to send the json data from the server like this ids: ["#root_node","#child_node_3"].

my tree is two laryers in depth only: parents and children, so based on above doc I should only send the parent node that contains that child node which has the search string in its title, and in the success section of the search ajax I can see that all the appropriate parent nodes are being passed by the server, but no results show up I am thinking it has to do with my formatting i pass a list of the id(s) of the parent nodes .

I will really appreciate if anyone had done this before and can share their approach or can just give any tips that may help!


ok I found the answer it is as the jstree document explains but it was with formatting, in my case the nodes had numeric names so basically passed in a link of node numbers but with a # sign next to each one, like [#1,#2] so it will load these two and the string should be in the children of these nodes. I hope this helps someone I spent more time than I thought it will take

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号