是否可以覆盖 jQuery 表排序器中的排序函数?
我目前正在使用 tablesorter 对一组图表进行排序。我通过使用隐藏文本嵌入图形内容代表的“数字”来实现此目的。然后,textExtraction 例程提取数字进行排序。
然而,这些图表实际上是针对两个不同的事物,我们称它们为 A 和 A 。 B,其中 B 节点是 A 节点之一的子节点。所以我真正想要的是根据不相关的 B 节点的父节点编号对它们进行排序,除非它们被排序到兄弟 B 节点。这将维持父节点和兄弟节点之间的关系。例如:
A1 (100)
B2 (25)
B3 (10)
A2 (50)
B1 (25)
B4 (5)
Where B2&B3 are parents of A1 and B1 & B4 are parents of A2
我是否可以重写排序方法来完成这个复杂的事情?
I'm currently using tablesorter to sort a set of graphs. I achieve this by using a hidden text to embed the "number" the graph contents represent. The textExtraction routine then pulls the number out for sorting.
However the graphs are actually for two separate things, lets call them A & B where a B node is a child of one of the A nodes. So what I really want is to sort unrelated B nodes with respect to their parents number unless they are being sorted to a sibling B node. This would maintain the relationship between the parent nodes and the siblings amongst themselves. For example:
A1 (100)
B2 (25)
B3 (10)
A2 (50)
B1 (25)
B4 (5)
Where B2&B3 are parents of A1 and B1 & B4 are parents of A2
Is there anyway I can override the sort method to do this complex thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简而言之,答案是否定的。
In short, the answer is no.