从表中删除jQuery tablesorter [英] Remove jQuery tablesorter from table

查看:62
本文介绍了从表中删除jQuery tablesorter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery tablesorter(http://tablesorter.com).

I am using the jQuery tablesorter (http://tablesorter.com).

$('#myTable').tablesorter()应用于表后,如何再次将其从表中删除?

After being applied to a table by $('#myTable').tablesorter(), how can I remove it again from the table?

推荐答案

没有内置函数可以执行此操作,但是您可以删除类名和事件绑定以停止其功能...尝试类似这个:

There isn't a built-in function to do this, but you could remove the class names and event bindings to stop its functioning... try something like this:

$('table')
 .unbind('appendCache applyWidgetId applyWidgets sorton update updateCell')
 .removeClass('tablesorter')
 .find('thead th')
 .unbind('click mousedown')
 .removeClass('header headerSortDown headerSortUp');

如果您正在运行传呼程序插件,则以上操作将无效.

The above won't work if you have the pager plugin running.

这篇关于从表中删除jQuery tablesorter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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