web/views/tableview.py
changeset 8003 7e240c04c69f
parent 8000 9a73d5e762b0
child 8006 32d7682991ce
--- a/web/views/tableview.py	Fri Oct 21 17:50:56 2011 +0200
+++ b/web/views/tableview.py	Fri Oct 21 17:52:37 2011 +0200
@@ -147,9 +147,9 @@
     def _setup_tablesorter(self, divid):
         self._cw.add_css('cubicweb.tablesorter.css')
         self._cw.add_js('jquery.tablesorter.js')
-        print '$("#%s table").tablesorter(%s);' % (divid, js_dumps(self.tablesorter_settings))
-        self._cw.add_onload('$("#%s table").tablesorter(%s);cw.log("done");' %
-                            (divid, js_dumps(self.tablesorter_settings)))
+        self._cw.add_onload('''$(document).ready(function() {
+    $("#%s table").tablesorter(%s);
+});''' % (divid, js_dumps(self.tablesorter_settings)))
 
     def __init__(self, req, view, **kwargs):
         super(TableLayout, self).__init__(req, **kwargs)
@@ -177,7 +177,6 @@
             self._cw.add_css(self.needs_css)
         if self.needs_js:
             self._cw.add_js(self.needs_js)
-        print self.enable_sorting
         if self.enable_sorting:
             self._setup_tablesorter(self.view.domid)
         # Notice facets form must be rendered **outside** the main div as it