I've a question to jQuery tablesorter. Is there a way to change the headers-attribute on run-time?
On start I do this:
$(document).ready(function() {
$("table").tablesorter({debug:false, headers: {4:{sorter:false}}});
});
In my Script there's a link:
<a href="javascript: xxx()">xxx</a>
This is calling this function:
function xxx() {
$("table").tablesorter({debug:false, headers: {3:{sorter: false}}});
}
The goal is to disable the third column, too. Do you habe any ideas?
To toggle the sorting of a column, you need to do two things:
sortDisabled
attribute on the header.$(function () {
$('table').tablesorter({
theme: 'blue'
});
$('button').click(function(){
var $th = $('th:contains(Sex)'),
status = !$th[0].sortDisabled;
$th.toggleClass('sorter-false', status );
$th[0].sortDisabled = status;
});
});