[table] Only apply sorting event on the first row of a table header (closes #1988780)
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 11 Oct 2011 18:16:52 +0200
changeset 7946 72d60e921341
parent 7945 5959f94c0358
child 7949 ce64860b3cdc
[table] Only apply sorting event on the first row of a table header (closes #1988780) We use the new selectorHeaders from table-sorter 2.0.5
web/views/tableview.py
--- a/web/views/tableview.py	Fri Oct 07 18:30:29 2011 +0200
+++ b/web/views/tableview.py	Tue Oct 11 18:16:52 2011 +0200
@@ -100,7 +100,8 @@
         req = self._cw
         req.add_js('jquery.tablesorter.js')
         req.add_onload('jQuery("table.listing").tablesorter({'
-                           'textExtraction: cubicwebSortValueExtraction' # use our own function
+                           'textExtraction: cubicwebSortValueExtraction,' # use our own function
+                           'selectorHeaders: "thead tr:first th"' # only plug on the first row
                        '});')
         req.add_css(('cubicweb.tablesorter.css', 'cubicweb.tableview.css'))
         # compute label first  since the filter form may remove some necessary