views:

94

answers:

0

I'm using tablesorter in on a table I added to a view in django's admin (although I'm not sure this is relevant). I'm extending the html's header:

{% block extrahead %}
 <script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.js"&gt;&lt;/script&gt; 
 <script type="text/javascript" src="http://mysite.com/media/tablesorter/jquery.tablesorter.js"&gt;&lt;/script&gt; 
 <script type="text/javascript">
  $(document).ready(function() 
      { $("#myTable").tablesorter(); } 
  ); 
 </script>
{% endblock %}

When I click on a column header, it sorts the table using this column in descending order - that's ok.

When I click the same column header a second time - it does not reorder to ascending order. What's wrong with it?

the table's html looks like:

<table  id="myTable" border="1">
<thead>
  <tr>
    <th>column_name_1</th>
    <th>column_name_2</th>
    <th>column_name_3</th>
  </tr>
</thead>
<tbody>
  {% for item in extra.items %}
    <tr>
      <td>{{ item.0|safe }} </td>
      <td>{{ item.1|safe }} </td>
      <td>{{ item.2|safe }} </td>
    </tr>
  {% endfor %}
</tbody>
</table>