--- a/web/data/cubicweb.js Fri Oct 21 17:50:56 2011 +0200
+++ b/web/data/cubicweb.js Fri Oct 21 17:52:37 2011 +0200
@@ -85,7 +85,7 @@
sortValueExtraction: function (node) {
var sortvalue = jQuery(node).attr('cubicweb:sortvalue');
- if (sortvalue === undefined) {
+ if (sortvalue === undefined) {
return '';
}
return sortvalue;
--- a/web/data/jquery.tablesorter.js Fri Oct 21 17:50:56 2011 +0200
+++ b/web/data/jquery.tablesorter.js Fri Oct 21 17:52:37 2011 +0200
@@ -684,7 +684,7 @@
function getCachedSortType(parsers, i) {
return parsers[i].type;
}; /* public methods */
- this.construct = function (settings) { cw.log(settings);
+ this.construct = function (settings) {
return this.each(function () {
// if no thead or tbody quit.
if (!this.tHead || !this.tBodies) return;
--- 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