jQuery表排序;动态添加行的问题 [英] JQuery table sorting; problem with dynamically added rows

查看:70
本文介绍了jQuery表排序;动态添加行的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jquery tablesorter插件( http://tablesorter.com/docs/)用于整理我的桌子.这适用于已经创建的行.但是,当我使用Jquery clone()方法动态添加一行时,排序不起作用.

I am using a jquery tablesorter plugin(http://tablesorter.com/docs/) for sorting my tables. This works for rows that created already. But when I add a row dynamically with Jquery clone() method, sorting is not working.

即使我动态添加行,我应该怎么做对行进行排序?

What I should I do to sort rows even if I add a row dynamically?

推荐答案

$('.tablesorter').trigger('update');.

Tablesorter仅扫描一次表,然后对内部存储的数字或文本值进行排序.实际上,它非常聪明,因为它使排序的动作变得非常快.

Tablesorter only scans through the table once, and after that it sorts on internally stored numeric or text values. It's quite clever, actually, as it makes the act of sorting super quick.

这篇关于jQuery表排序;动态添加行的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆