带有隐藏行的 JQuery Tablesort?
我有一个表,它使用 jquery hide() 和 show() 来操作标准视图。但是,当我包含表排序时,它仅对可见行进行排序,而不对隐藏行进行排序。有没有办法让它对所有项目进行排序?
我刚刚意识到我正在我的 xslt 中设置 HIDEME 类,jquery 中的隐藏和显示函数正在使用它。这意味着我的排序器做得正确,但是我隐藏了错误的数据。所以我想我需要将我的问题修改为...如何显示表格的前 n 行,然后单击外部按钮显示所有其他行。然后,当我进行排序时,它需要知道隐藏/显示时新订单的用途/
如此令人困惑......有人可以帮忙吗?
克里斯
I have a table which uses the jquery hide() and show() to manipulate the standard view. However when i include the table sort it only sorts on the visible rows and not the hidden ones. Is there anyway to get it to sort on all the items?
I have just realised that i was setting my class of HIDEME in my xslt which the hide and show functions in my jquery were using. This meant that my sorter was doing it correctly however i was hiding the data wrong.. So i guess i need to modify my question to...How can i show the first n rows of a table then on the click of an external button show all the other rows. Then when i do the sort it needs to know what the new order is for when it does the hide/show/
So confusing..can anyone help?
Chris
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我没有尝试过使用 jQuery 的函数进行排序,但您可能会发现这很有帮助。
http://www.packtpub.com/article/jquery-table-manipulation-第 1 部分
另一种选择是自己获取所有行,并在行上使用 javascript 的
sort
函数,这样您就可以就地排序,这样您就可以选择要排序的列或列排序。但是,无论如何,当您完成排序后,您可能需要再次更改每行的类以替换颜色。
I haven't tried to sort with jQuery's functions, but you may find this helpful.
http://www.packtpub.com/article/jquery-table-manipulation-part1
The other option is to just get all the rows yourself and using javascript's
sort
function on the rows, so you can sort in-place, this way you can pick which column or columns to sort on.But, in any event, when you are finished sorting you will probably need to change the classes again for alternating colors, for each row.