Reputation: 129
I'm trying to disable the first column of a table with the JQuery plugin tablesorter 2.0.5
While it does disable, I can't sort other columns properly anymore. I can only click once on a column and then have to click once on another column to be able to click again (still only once), as described in this post.
I have followed this first example and this other example
and here's the code I include in the php view
echo '<script type="text/javascript" language="JavaScript">
$(document).ready(function() {
$("table").tablesorter({
headers: {
0: {sorter: false}
}
});
});
</script>';
Upvotes: 1
Views: 1755
Reputation: 86403
Ok, here is a jsFiddle demo for you
Your code looks okay, except that the language
attribute is no longer necessary, so I'm not sure where you might be having your problem.
echo '<script type="text/javascript">
$(document).ready(function() {
$("table").tablesorter({
headers: {
0: {sorter: false}
}
});
});
</script>';
Things to check would be:
table
is the correct target for tablesorter. You may need to add an ID or class name to the table then target it, e.g. $("#mytable")
.Upvotes: 1