I am setting up customExtraction for the jQuery plugin tablesorter control (which probably doesn't matter), and sorting works in IE, but not in Chrome or Firefox. Here is a snippet of JavaScript code:
var searchResultsTables = $("table.FilterClass");
searchResultsTables.tablesorter({
widgets: ['zebra'],
widgetZebra: { css: ["Odd", "Even"] },
headers:
{
3: { textExtraction: function (node)
{
return $(node).find("img").length;
}
},
4: { sorter: false }
}
}
);
Node is <td>(I believe). Some cells have an image in them, while others do not. So basically, this column should be sorted based on 0/1. All other columns are sorted just fine (except for the 5th column, which, as you can see, is not sorted).
Here is some html on which the type acts (2 lines):
<table class="SearchResultsTable FilterClass tablesorter">
<tr class="Odd">
<td class="SearchResultsCell RightBrownBorder NameCell">
<a href="/Candidate/2">Bill Clinton</a></td>
<td class="SearchResultsCell RightBrownBorder PartyCell">Democrat</td>
<td class="SearchResultsCell RightBrownBorder DistrictCell"></td>
<td class="SearchResultsCell RightBrownBorder IncumbentCell">
<img src="/Images/green_check_mark.gif" />
</td>
<td class="SearchResultsCell PoliticalSpectrumIndexCell"></td>
</tr>
<tr class="Even">
<td class="SearchResultsCell RightBrownBorder NameCell">
<a href="/Candidate/13">Newt Gingrich</a></td>
<td class="SearchResultsCell RightBrownBorder PartyCell" title="Party for Socialism and Liberation">Party for...</td>
<td class="SearchResultsCell RightBrownBorder DistrictCell"></td>
<td class="SearchResultsCell RightBrownBorder IncumbentCell"></td>
<td class="SearchResultsCell PoliticalSpectrumIndexCell"></td>
</tr>
Any ideas why this will not work in Chrome or Firefox?
source
share