From d7854ed8f1af5b203efad976c04a43f80b336a2b Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Wed, 1 Sep 2010 07:39:57 -0500 Subject: Make sort work on developer todo list status Because it was a link, the sort didn't properly sort on the complete/incomplete status when viewing a todo list. Add a custom parser to fix it. Signed-off-by: Dan McGee --- templates/todolists/view.html | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/todolists/view.html b/templates/todolists/view.html index b5f9a320..504c8cbb 100644 --- a/templates/todolists/view.html +++ b/templates/todolists/view.html @@ -69,8 +69,20 @@

Todo List: {{ list.name }}

return false; }); }); +$.tablesorter.addParser({ + id: 'todostatus', + is: function(s) { return false; }, + format: function(s) { + return s.match(/incomplete/) ? 1 : 0; + }, + type: 'numeric' +}); $(document).ready(function() { - $(".results").tablesorter({widgets: ['zebra'], sortList: [[0,0], [1,0]]}); + $(".results").tablesorter({ + widgets: ['zebra'], + sortList: [[0,0], [1,0]], + headers: { 4: { sorter: 'todostatus' } } + }); }); {% endblock %} -- cgit v1.2.3-54-g00ecf