Notes

  • This widget allows the enabling or disabling of tablesorter sorting & filtering.
  • The widget does not reset an applied sort or filters. If you want to include this when disabling, use the following code:
  • *ALERT* This widget requires tablesorter v2.22.4+ and jQuery 1.7+

Options

TIP! Click on the link in the option column to reveal full details (or toggle|show|hide all) or double click to update the browser location.
OptionDefaultDescription
toggleTS_hideFilterRow false If true, hide filter row; when false, associated filters are disabled.
null This function is called after tablesorter has been enabled or disabled.

Use it as follows:

$( function() {
  $( 'table' ).tablesorter({
    widget : [ 'toggle-ts' ],
    widgetOptions : {
      toggleTS_callback : function( c, isEnabled ) {
        c.$table.toggleClass( 'isDisabled', !isEnabled );
      }
    }
  });
});

Demo

Tablesorter & Filter: Hide Filter Row:

Filter any column:

Filter (this works even if tablesorter & filter are disabled)

Rank First Name Last Name Age Total (filter disabled) Discount (sort disabled) Date
1Philip Aaron WongJohnson Sr Esq25$5.9522%Jun 26, 2004 7:22 AM
11AaronHibert12$2.995%Aug 21, 2009 12:21 PM
12Brandon ClarkHenry Jr51$42.2918%Oct 13, 2000 1:15 PM
111PeterParker28$9.9920%Jul 6, 2006 8:14 AM
21JohnHood33$19.9925%Dec 10, 2002 5:14 AM
013ClarkKent Sr.18$15.8944%Jan 12, 2003 11:14 AM
005BruceAlmighty Esq45$153.1944%Jan 18, 2021 9:12 AM
10AlexDumass13$5.294%Jan 8, 2012 5:11 PM
16JimFranco24$14.1914%Jan 14, 2004 11:23 AM
166Bruce LeeEvans22$13.1911%Jan 18, 2007 9:12 AM
100Brenda DexterMcMasters18$55.2015%Feb 12, 2010 7:23 PM
55DennisBronson65$123.0032%Jan 20, 2001 1:12 PM
9MarthadelFuego25$22.0917%Jun 11, 2011 10:55 AM

Javascript


	

HTML