当前位置:网站首页>2021-10-25 how to jump after searching for too many boost treeview component nodes?

2021-10-25 how to jump after searching for too many boost treeview component nodes?

2022-07-23 05:42:00 sunbcy

  • Here's the picture , When there are too many nodes in the tree , The current page is no longer available .
  • This is the time , If you are perfecting the search function of the tree component , You may need to do an anchor jump .
  • If your needs are like mine , There are many overlapping names in the nodes of the tree . For example, your tree is a classification tree , The name of the parent class often overlaps with the name of the child class , For example, there are many games XXX Game , Then the anchor location can only jump to one place at a time , Then your fuzzy query search results need to establish a search result area next to it like me , Then click the search results , Jump in the middle of the tree on the left

 My tree component

Jump problem , Cannot leave an anchor .

But I don't know how to realize it , If someone is like me , Please leave your idea. I'm already looking at the source code bootstrap-treeview.js 了 , If you enter the exhibition, share with you !

2021/10.27:
Take a little note , The above problems have been solved ! A little excited , After all, it's the first time to do front-end , After all, this problem stuck me for three days , All exploration is valuable !
Because I'm too white , In fact, the jump problem is very straightforward .

1 The idea of using anchors is no problem

The reason why we didn't use anchors before is that the original nodes of its components simply don't exist id This attribute . I'm Xiaobai again , Yes bootstrap-treeview This component of is unfamiliar , In these difficult three days , I'm too free to read its source document bootstrap-treeview.js(2.1 Version of ). Later in the source js Where the initialization node is found , Try adding id It turned out .

2 You can also use javascript/jQuery Select elements according to their custom attributes to realize jump .

原网站

版权声明
本文为[sunbcy]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/204/202207221755141115.html