I want to use tablesorter.js.
In FireBug when I launch $("#myTable").tablesorter();, it returns [table#myTable.table].
But when I want to sort with $("#myTable").tablesorter( {sortList: [[0,0], [1,0]]} );, it returns this error :
TypeError: table.config.parsers is undefined
...tion("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? ...
jquery.tablesorter.js (ligne 600)
There’s no error at page launching and I use ready function to lauch tablesorter.
Here a short version :
<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>
I use bootstrap from twitter.
Instead of re-initializing the plugin to change the sort on a table, a
sortonevent should be triggered on the table. See this demo, and try this code:I also made this demo to show that using the
sortListoption should work.But I wonder if you’re only having this issue in IE? I seem to remember IE not liking camel-cased ID’s… maybe try changing the table id to
mytableinstead ofmyTable.