javascript - Tablesorter - One column table, remove sorting but keep search for that column -


so here link table. can't disable sorting feature without disabling search column well. im using filter widget external search incase helps.

here js coding

$(function() {  var $table = $('table').tablesorter({     theme: 'blue',     widgets: ["zebra", "filter"],     widgetoptions : {         // filter_anymatch replaced! instead use filter_external option         // set use jquery selector (or jquery object) pointing         // external filter (column specific or match)         filter_external : '.search',         // add default type search first name column         filter_defaultfilter: { 1 : '~{query}' },         // include column filters         filter_columnfilters: false,         filter_placeholder: { search : 'search...' },         filter_savefilters : true,         filter_reset: '.reset'      } }); // make demo search buttons work $('button[data-column]').on('click', function(){     var $this = $(this),         totalcolumns = $table[0].config.columns,         col = $this.data('column'), // zero-based index or "all"         filter = [];      // text add filter     filter[ col === 'all' ? totalcolumns : col ] = $this.text();     $table.trigger('search', [ filter ]);     return false; }); 

});

all need add "sorter-false" class name header:

<th class="column-1 sorter-false"></th> 

here demo


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -