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; });
});
Comments
Post a Comment