From 5e315adb266ab4a89e885f8c2eef2e3eb8301ae3 Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Thu, 5 Dec 2013 12:35:55 +0100 Subject: [PATCH] implements on_show, and cleanup querytable_draw_callback --- plugins/querytable/static/js/querytable.js | 31 +--------------------- 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/plugins/querytable/static/js/querytable.js b/plugins/querytable/static/js/querytable.js index 57b260dc..6fc65617 100644 --- a/plugins/querytable/static/js/querytable.js +++ b/plugins/querytable/static/js/querytable.js @@ -65,7 +65,7 @@ on_show: function(e) { var self = e.data; - self.table.fnAdjustColumnSizing() + self.redraw_table(); }, // on_show /* GUI EVENTS */ @@ -396,35 +396,6 @@ return ret; }, - _querytable_draw_callback: function() { - /* - * Handle clicks on checkboxes: reassociate checkbox click every time - * the table is redrawn - */ - this.elts('querytable-checkbox').unbind('click').click(this, this._check_click); - - if (!this.table) - return; - - /* Remove pagination if we show only a few results */ - var wrapper = this.table; //.parent().parent().parent(); - var rowsPerPage = this.table.fnSettings()._iDisplayLength; - var rowsToShow = this.table.fnSettings().fnRecordsDisplay(); - var minRowsPerPage = this.table.fnSettings().aLengthMenu[0]; - - if ( rowsToShow <= rowsPerPage || rowsPerPage == -1 ) { - $('.querytable_paginate', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_paginate', wrapper).css('visibility', 'visible'); - } - - if ( rowsToShow <= minRowsPerPage ) { - $('.querytable_length', wrapper).css('visibility', 'hidden'); - } else { - $('.querytable_length', wrapper).css('visibility', 'visible'); - } - }, - _check_click: function(e) { e.stopPropagation(); -- 2.43.0