I implemented the jquery tablesorter and am trying to set one column to not sort. I followed the documentation but something isn't working because it still sorts. Here is the code.
I copied the whole function but I am pretty sure you only need the code inside the get.
function displayPid() {
var x = $("#selectPub").val();
if (x == 0) {
return;
}
$.get('content_backend_pub_pid_2_5.ashx', { cmd: '2', pubid: x开发者_StackOverflow社区 }, function(o) {
$("#inputDiv2").html(o);
$(".sortable th").addClass("sort_header");
$(".sortable").tablesorter({ widgets: ["zebra"], headers: { 3: { sorter: false}} });
$(".sortable tr").mouseover(function() { $(this).addClass("over"); });
$(".sortable tr").mouseout(function() { $(this).removeClass("over"); });
});
//$("#inputDiv4").html("");
//displaySelectMid();
}
Also, I tried another alternative. I added the jquery.metadata.js file and in the th tag I wrote...
class="{sorter:false}"
That did not work either. I am thinking it has something to do with my css styles?
And this is the html it produces...
<th id="editheader" class="{sorter:false} sort_header header">Edit </th>
Any help is appreciated. Thanks!
So, I finally figured it out. I forgot I had a couple hidden th's in my code, so it was working but it was setting the sorter false to a hidden row! Lol! I changed the index to 5 and it works great.
I am so dumb, I am really dumb, for real. ;-)
精彩评论