tablesorter.js
を使いたい。
FireBugで起動する$("#myTable").tablesorter();
と、が返されます[table#myTable.table]
。
しかし、でソートしたい場合$("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );
、このエラーが返されます:
TypeError: table.config.parsers is undefined
...tion("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? ...
jquery.tablesorter.js (ligne 600)
ページの起動時にエラーは発生せず、ready
関数を使用してテーブルソーターを起動します。
ここに短いバージョンがあります:
<script type="text/javascript" src="/static/js/jquery.tablesorter.js"></script>
<script type='text/javascript'>
$(function() {
$("#myTable").tablesorter();
});
</script>
<table id="myTable" class="table table-condensed table-striped tablesorter">
<thead>
<tr>
<th></th>
<th>Nom</th>
<th>Taille</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
Twitterのブートストラップを使用しています。