Remove jQuery tablesorter from table

后端 未结 4 389
星月不相逢
星月不相逢 2020-12-11 15:18

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

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

4条回答
  •  轮回少年
    2020-12-11 16:03

    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.

提交回复
热议问题