递归树索引的顺序?
我有一棵树,其中所有叶子都有索引,当树从数据库中递归加载时,数据库将按索引对树进行排序。首先它获取按索引排序的根节点等。现在我需要实现用户如何通过按向上/向下箭头图标对这些索引进行排序的操作。当用户按下时,索引应该采用其自己索引下的索引,当按下向上箭头时,反之亦然。我只是不知道实现这种功能的最佳方法是什么。
I have tree where all leafs have index, when tree is rescursively lodaded form database, database will order tree by indexes. First it gets root nodes sorted by index and so on. Now I need to implement action how user can sort these indexes by pressing up/down arrow icons. When user presses down then index should take index that is under it's own index and when up arrow is pressed it should do vice versa. I just don't know what would be best way to implement this kind of functionality.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于你的问题有点模糊,这个答案假设你知道你在数据库方面做什么(如果不知道的话,我会推荐 hibernate for java),下面的代码旨在为你提供一些实现解决方案的想法。
Since your question is a bit vague, this answer assumes you know what you are doing when it comes to the database stuff (I would reccommend hibernate for java if not) and the following code is meant to give you some ideas for implementing your solution.