最新の Jquery テーブル ソーター プラグインを使用しようとしています。 http://mottie.github.com/tablesorter/docs/#Demo
問題は、日付形式のテーブル列があり、メールの値も含まれていることです。日付値を抽出し、日付値に基づいて並べ替えようとしています。
テーブルソーターの最新バージョンを使用しているため、 latest(http://mottie.github.com/tablesorter/docs/example-parsers-class-name.html) で利用可能なパーサークラス名を使用しようとしました。
以下の私のフィドルを見つけてください。
http://jsfiddle.net/meetravi/pztqe/8/
コードスニペット:
<tr>
<th>Name</th>
<th>Major</th>
<th>Sex</th>
<th>English</th>
<th>Japanese</th>
<th>Calculus</th>
<th>Geometry</th>
<th class="sorter-shortDate">Date</th>
</tr>
<tbody>
<tr>
<td>Student01</td>
<td>Languages</td>
<td>male</td>
<td>80</td>
<td>70</td>
<td>75</td>
<td>80</td>
<td><em>11/01/12 11:42</em><spanclass="label">xyz@xyz.com</span></td>
</tr>
</tbody>
<script type="text/javascript">
$(document).ready(function(){
$('#table-Id').tablesorter({
theme: 'blue',
dateFormat : "ddmmyy",
textExtraction: {
7: function(node, table, cellIndex) {
return $(node).find("em").text();
}
}
});
});
</script>