From 12177fc971077717e574854c6e2997aa23042dc4 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Thu, 13 Oct 2011 20:57:46 -0500 Subject: [PATCH] disable/enable pager --- README.markdown | 28 +++ addons/pager/jquery.tablesorter.pager.js | 247 +++++++++++-------- addons/pager/jquery.tablesorter.pager.min.js | 4 +- changelog.txt | 27 ++ docs/css/jq.css | 6 +- docs/example-pager.html | 158 +++++++++--- docs/index.html | 76 ++++-- js/jquery.tablesorter.js | 5 +- js/jquery.tablesorter.min.js | 5 +- 9 files changed, 374 insertions(+), 182 deletions(-) diff --git a/README.markdown b/README.markdown index 0315bd08..f6be3b20 100644 --- a/README.markdown +++ b/README.markdown @@ -28,6 +28,34 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt). +#### Version 2.0.22 (2011-10-13) + +* Updated the pager plugin: + * Fixed a problem that occurred when `removeRows` is set to false - fix for [issue #4](https://github.com/Mottie/tablesorter/issues/4). + * Added "disable.pager" and "enable.pager" methods to the pager. These are useful if you want to delete a table row with the pager applied. + + ```javascript + // Delete a row + // this function targets a button with a "remove" class name inside a table row + // ************* + // Use delegate or live because `removeRows` is set to `true` in the demo - hidden rows don't exist + $('table').delegate('button.remove', 'click' ,function(){ + var t = $('table'); + // disabling the pager will restore all table rows + t.trigger('disable.pager'); + // remove the chosen row + $(this).closest('tr').remove(); + // restore pager + t.trigger('enable.pager'); + }); + ``` + + * Fixed the `positionFixed` option (which positions the pager below the table) to now include the `offset` option value. + * Fixed the pager arrow buttons so that destroying and enabling the pager multiple times doesn't multiply the number of pages changed. + * Updated the pager demo page to allow deleting rows. + * General cleanup and added lots of comments in the plugin and demo page on what each pager option does. +* Made one minor change to the tablesorter plugin to accomidate the pager plugin using the `removeRows` option. + #### Version 2.0.21.1 (2011-10-11) * Added "stickyHeader" widget to the "jquery.tablesorter.widgets.js" file. diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 65967ac2..f1726fec 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /* * tablesorter pager plugin - * updated 9/8/2011 + * updated 11/13/2011 */ (function($) { @@ -8,22 +8,15 @@ // hide arrows at extremes var pagerArrows = function(c) { + var a = 'addClass', r = 'removeClass', d = c.cssDisabled; if (c.updateArrows) { - c.container.removeClass(c.cssDisabled); - $(c.cssFirst + ',' + c.cssPrev + ',' + c.cssNext + ',' + c.cssLast, c.container).removeClass(c.cssDisabled); - if (c.page === 0) { - $(c.cssFirst + ',' + c.cssPrev, c.container).addClass(c.cssDisabled); - } else if (c.page === c.totalPages - 1) { - $(c.cssNext + ',' + c.cssLast, c.container).addClass(c.cssDisabled); - } - // if the total # of pages is less than the selected number of visible rows, then hide the pager - if (c.totalRows < c.size) { - c.container.addClass(c.cssDisabled); - } + c.container[(c.totalRows < c.size) ? a : r](d); + $(c.cssFirst + ',' + c.cssPrev, c.container)[(c.page === 0) ? a : r](d); + $(c.cssNext + ',' + c.cssLast, c.container)[(c.page === c.totalPages - 1) ? a : r](d); } }, - updatePageDisplay = function(table,c) { + updatePageDisplay = function(table, c) { c.startRow = c.size * (c.page) + 1; c.endRow = Math.min(c.totalRows, c.size * (c.page+1)); var out = $(c.cssPageDisplay, c.container), @@ -47,12 +40,12 @@ $(table).trigger('pagerComplete', c); }, - fixPosition = function(table) { - var c = table.config, o = $(table); + fixPosition = function(table, c) { + var o = $(table); if (!c.pagerPositionSet && c.positionFixed) { if (o.offset) { c.container.css({ - top: o.offset().top + o.height() + 'px', + top: o.offset().top + o.height() + c.offset + 'px', position: 'absolute' }); } @@ -71,25 +64,34 @@ } }, - renderTable = function(table,rows) { + hideRowsSetup = function(table, c){ + c.size = parseInt($(c.cssPageSize, c.container).val(), 10); + pagerArrows(c); + if (!c.removeRows) { + hideRows(table, c); + $(table).bind('sortEnd.pager', function(){ + hideRows(table, c); + $(table).trigger("applyWidgets"); + }); + } + }, + + renderTable = function(table, rows, c) { var i, j, o, - tableBody, - c = table.config, + tableBody = $(table.tBodies[0]), l = rows.length, s = (c.page * c.size), e = (s + c.size); - $(table).trigger('pagerChange',c); + $(table).trigger('pagerChange', c); if (!c.removeRows) { hideRows(table, c); } else { if (e > rows.length ) { e = rows.length; } - tableBody = $(table.tBodies[0]); // clear the table body $.tablesorter.clearTableBody(table); - for(i = s; i < e; i++) { - //tableBody.append(rows[i]); + for (i = s; i < e; i++) { o = rows[i]; l = o.length; for (j = 0; j < l; j++) { @@ -97,144 +99,171 @@ } } } - fixPosition(table,tableBody); + fixPosition(table, tableBody, c); $(table).trigger("applyWidgets"); if ( c.page >= c.totalPages ) { - moveToLastPage(table); + moveToLastPage(table, c); } - updatePageDisplay(table,c); + updatePageDisplay(table, c); }, - moveToPage = function(table) { - var c = table.config; + showAllRows = function(table, c){ + c.lastPage = c.page; + c.size = c.totalRows; + c.totalPages = 1; + renderTable(table, c.rowsCopy, c); + }, + + moveToPage = function(table, c) { + if (c.isDisabled) { return; } if (c.page < 0 || c.page > (c.totalPages-1)) { c.page = 0; } - renderTable(table,c.rowsCopy); + renderTable(table, c.rowsCopy, c); }, - setPageSize = function(table,size) { - var c = table.config; + setPageSize = function(table, size, c) { c.size = size; c.totalPages = Math.ceil(c.totalRows / c.size); c.pagerPositionSet = false; - moveToPage(table); - fixPosition(table); + moveToPage(table, c); + fixPosition(table, c); }, - moveToFirstPage = function(table) { - var c = table.config; + moveToFirstPage = function(table, c) { c.page = 0; - moveToPage(table); + moveToPage(table, c); }, - moveToLastPage = function(table) { - var c = table.config; + moveToLastPage = function(table, c) { c.page = (c.totalPages-1); - moveToPage(table); + moveToPage(table, c); }, - moveToNextPage = function(table) { - var c = table.config; + moveToNextPage = function(table, c) { c.page++; - if(c.page >= (c.totalPages-1)) { + if (c.page >= (c.totalPages-1)) { c.page = (c.totalPages-1); } - moveToPage(table); + moveToPage(table, c); }, - moveToPrevPage = function(table) { - var c = table.config; + moveToPrevPage = function(table, c) { c.page--; - if(c.page <= 0) { + if (c.page <= 0) { c.page = 0; } - moveToPage(table); + moveToPage(table, c); }, - destroyPager = function(table){ - var c = table.config; - c.size = c.totalRows; - c.totalPages = 1; - renderTable(table,c.rowsCopy); - // hide pager - c.container.hide(); - c.appender = null; - $(table).unbind('destroy.pager sortStart.pager'); + destroyPager = function(table, c){ + showAllRows(table, c); + c.container.hide(); // hide pager + c.appender = null; // remove pager appender function + $(table).unbind('destroy.pager sortEnd.pager enable.pager disable.pager'); + }, + + enablePager = function(table, c){ + c.isDisabled = false; + $('table').trigger('update'); + c.page = c.lastPage || 0; + c.totalPages = Math.ceil(c.totalRows / c.size); + hideRowsSetup(table, c); }; - this.appender = function(table,rows) { + this.appender = function(table, rows) { var c = table.config; c.rowsCopy = rows; c.totalRows = rows.length; c.totalPages = Math.ceil(c.totalRows / c.size); - renderTable(table,rows); + renderTable(table, rows, c); }; this.defaults = { - size: 10, - offset: 0, + // target the pager markup + container: null, + + // output default: '{page}/{totalPages}' + output: '{startRow} to {endRow} of {totalRows} rows', // '{page}/{totalPages}' + + // apply disabled classname to the pager arrows when the rows at either extreme is visible + updateArrows: true, + + // starting page of the pager (zero based index) page: 0, + + // Number of visible rows + size: 10, + + // if true, moves the pager below the table at a fixed position; so if only 2 rows showing, the pager remains in the same place + positionFixed: true, + + // offset added to the pager top, but only when "positionFixed" is true + offset: 0, + + // remove rows from the table to speed up the sort of large tables. + // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled. + removeRows: true, // removing rows in larger tables speeds up the sort + + // css class names of pager arrows + cssNext: '.next', // next page arrow + cssPrev: '.prev', // previous page arrow + cssFirst: '.first', // first page arrow + cssLast: '.last', // last page arrow + cssPageDisplay: '.pagedisplay', // location of where the "output" is displayed + cssPageSize: '.pagesize', // page size selector - select dropdown that sets the "size" option + + // class added to arrows when at the extremes (i.e. prev/first arrows are "disabled" when on the first page) + cssDisabled: 'disabled', // Note there is no period "." in front of this class name + + // stuff not set by the user totalRows: 0, totalPages: 0, - container: null, - cssNext: '.next', - cssPrev: '.prev', - cssFirst: '.first', - cssLast: '.last', - cssPageDisplay: '.pagedisplay', - cssPageSize: '.pagesize', - cssDisabled: 'disabled', - output: '{page}/{totalPages}', // '{startRow} to {endRow} of {totalRows} rows', - updateArrows: false, - positionFixed: true, - removeRows: true, // removing rows in larger tables speeds up the sort appender: this.appender }; this.construct = function(settings) { return this.each(function() { - var config = $.extend(this.config, $.tablesorterPager.defaults, settings), + var c = $.extend(this.config, $.tablesorterPager.defaults, settings), table = this, - pager = config.container; + pager = c.container; $(this).trigger("appendCache"); - config.size = parseInt($(".pagesize",pager).val(), 10); - pagerArrows(config); - if (!config.removeRows) { - config.appender = null; - hideRows(table, config); - $(this).bind('sortEnd.pager', function(){ - hideRows(table, config); - $(table).trigger("applyWidgets"); + hideRowsSetup(table, c); + + $(c.cssFirst,pager).unbind('click.pager').bind('click.pager', function() { + moveToFirstPage(table, c); + return false; + }); + $(c.cssNext,pager).unbind('click.pager').bind('click.pager', function() { + moveToNextPage(table, c); + return false; + }); + $(c.cssPrev,pager).unbind('click.pager').bind('click.pager', function() { + moveToPrevPage(table, c); + return false; + }); + $(c.cssLast,pager).unbind('click.pager').bind('click.pager', function() { + moveToLastPage(table, c); + return false; + }); + $(c.cssPageSize,pager).unbind('change.pager').bind('change.pager', function() { + setPageSize(table, parseInt($(this).val(), 10), c); + return false; + }); + + $(this) + .unbind('disable.pager enable.pager destroy.pager') + .bind('disable.pager', function(){ + c.isDisabled = true; + showAllRows(table, c); + }) + .bind('enable.pager', function(){ + enablePager(table, c); + }) + .bind('destroy.pager', function(){ + destroyPager(table, c); }); - } - - $(config.cssFirst,pager).click(function() { - moveToFirstPage(table); - return false; - }); - $(config.cssNext,pager).click(function() { - moveToNextPage(table); - return false; - }); - $(config.cssPrev,pager).click(function() { - moveToPrevPage(table); - return false; - }); - $(config.cssLast,pager).click(function() { - moveToLastPage(table); - return false; - }); - $(config.cssPageSize,pager).change(function() { - setPageSize(table,parseInt($(this).val(), 10)); - return false; - }); - - $(this).bind('destroy.pager', function(){ - destroyPager(table); - }); - }); }; diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index 9404a19c..c468ac48 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,2 +1,2 @@ -/* tablesorter pager plugin */ -(function(d){d.extend({tablesorterPager:new function(){var l=function(a){a.updateArrows&&(a.container.removeClass(a.cssDisabled),d(a.cssFirst+","+a.cssPrev+","+a.cssNext+","+a.cssLast,a.container).removeClass(a.cssDisabled),a.page===0?d(a.cssFirst+","+a.cssPrev,a.container).addClass(a.cssDisabled):a.page===a.totalPages-1&&d(a.cssNext+","+a.cssLast,a.container).addClass(a.cssDisabled),a.totalRowsh&&(f=h);for(c=0;c=j&&cb.length)i=b.length;j=d(a.tBodies[0]);for(d.tablesorter.clearTableBody(a);c=f.totalPages&&n(a);o(a,f)},g=function(a){var b=a.config;if(b.page<0||b.page>b.totalPages-1)b.page=0;i(a,b.rowsCopy)},n=function(a){var b=a.config;b.page=b.totalPages-1;g(a)};this.appender=function(a,b){var c=a.config;c.rowsCopy=b;c.totalRows=b.length;c.totalPages=Math.ceil(c.totalRows/c.size);i(a,b)};this.defaults={size:10,offset:0,page:0,totalRows:0,totalPages:0,container:null,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize", cssDisabled:"disabled",output:"{page}/{totalPages}",updateArrows:!1,positionFixed:!0,removeRows:!0,appender:this.appender};this.construct=function(a){return this.each(function(){var b=d.extend(this.config,d.tablesorterPager.defaults,a),c=this,e=b.container;d(this).trigger("appendCache");b.size=parseInt(d(".pagesize",e).val(),10);l(b);if(!b.removeRows)b.appender=null,k(c,b),d(this).bind("sortEnd.pager",function(){k(c,b);d(c).trigger("applyWidgets")});d(b.cssFirst,e).click(function(){c.config.page= 0;g(c);return!1});d(b.cssNext,e).click(function(){var a=c.config;a.page++;if(a.page>=a.totalPages-1)a.page=a.totalPages-1;g(c);return!1});d(b.cssPrev,e).click(function(){var a=c.config;a.page--;if(a.page<=0)a.page=0;g(c);return!1});d(b.cssLast,e).click(function(){n(c);return!1});d(b.cssPageSize,e).change(function(){var a=parseInt(d(this).val(),10),b=c.config;b.size=a;b.totalPages=Math.ceil(b.totalRows/b.size);b.pagerPositionSet=!1;g(c);m(c);return!1});d(this).bind("destroy.pager",function(){var a= c.config;a.size=a.totalRows;a.totalPages=1;i(c,a.rowsCopy);a.container.hide();a.appender=null;d(c).unbind("destroy.pager sortStart.pager")})})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery); +/* tablesorter pager plugin - updated 11/13/2011 */ +(function(d){d.extend({tablesorterPager:new function(){var j=function(c){var a=c.cssDisabled;c.updateArrows&&(c.container[c.totalRowsg&&(i=g);for(b=0;b=f&&ba.length)l=a.length;for(d.tablesorter.clearTableBody(c);e=b.totalPages)b.page=b.totalPages-1,f(c,b);p(c,b)},o=function(c,a){a.lastPage=a.page;a.size=a.totalRows;a.totalPages=1;h(c,a.rowsCopy,a)},f=function(c,a){if(!a.isDisabled){if(a.page<0||a.page>a.totalPages-1)a.page=0;h(c,a.rowsCopy,a)}};this.appender=function(c,a){var b=c.config;b.rowsCopy=a;b.totalRows=a.length;b.totalPages=Math.ceil(b.totalRows/b.size);h(c,a,b)};this.defaults={container:null,output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:true, page:0,size:10,positionFixed:true,offset:0,removeRows:true,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0,appender:this.appender};this.construct=function(c){return this.each(function(){var a=d.extend(this.config,d.tablesorterPager.defaults,c),b=this,e=a.container;d(this).trigger("appendCache");n(b,a);d(a.cssFirst,e).unbind("click.pager").bind("click.pager",function(){a.page=0;f(b, a);return false});d(a.cssNext,e).unbind("click.pager").bind("click.pager",function(){a.page++;if(a.page>=a.totalPages-1)a.page=a.totalPages-1;f(b,a);return false});d(a.cssPrev,e).unbind("click.pager").bind("click.pager",function(){a.page--;if(a.page<=0)a.page=0;f(b,a);return false});d(a.cssLast,e).unbind("click.pager").bind("click.pager",function(){a.page=a.totalPages-1;f(b,a);return false});d(a.cssPageSize,e).unbind("change.pager").bind("change.pager",function(){var c=parseInt(d(this).val(),10); a.size=c;a.totalPages=Math.ceil(a.totalRows/a.size);a.pagerPositionSet=false;f(b,a);m(b,a);return false});d(this).unbind("disable.pager enable.pager destroy.pager").bind("disable.pager",function(){a.isDisabled=true;o(b,a)}).bind("enable.pager",function(){a.isDisabled=false;d("table").trigger("update");a.page=a.lastPage||0;a.totalPages=Math.ceil(a.totalRows/a.size);n(b,a)}).bind("destroy.pager",function(){o(b,a);a.container.hide();a.appender=null;d(b).unbind("destroy.pager sortEnd.pager enable.pager disable.pager")})})}}}); d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery); diff --git a/changelog.txt b/changelog.txt index 915ee51c..5d6d1362 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,32 @@ TableSorter Change Log +Version 2.0.22 (2011-10-13) +============================ + +* Updated the pager plugin: + * Fixed a problem that occurred when `removeRows` is set to false - fix for [issue #4](https://github.com/Mottie/tablesorter/issues/4). + * Added "disable.pager" and "enable.pager" methods to the pager. These are useful if you want to delete a table row with the pager applied. + + // Delete a row + // this function targets a button with a "remove" class name inside a table row + // ************* + // Use delegate or live because `removeRows` is set to `true` in the demo - hidden rows don't exist + $('table').delegate('button.remove', 'click' ,function(){ + var t = $('table'); + // disabling the pager will restore all table rows + t.trigger('disable.pager'); + // remove the chosen row + $(this).closest('tr').remove(); + // restore pager + t.trigger('enable.pager'); + }); + + * Fixed the `positionFixed` option (which positions the pager below the table) to now include the `offset` option value. + * Fixed the pager arrow buttons so that destroying and enabling the pager multiple times doesn't multiply the number of pages changed. + * Updated the pager demo page to allow deleting rows. + * General cleanup and added lots of comments in the plugin and demo page on what each pager option does. +* Made one minor change to the tablesorter plugin to accomidate the pager plugin using the `removeRows` option. + Version 2.0.21.1 (2011-10-11) ============================ diff --git a/docs/css/jq.css b/docs/css/jq.css index 816aeba0..a6c567c3 100644 --- a/docs/css/jq.css +++ b/docs/css/jq.css @@ -45,4 +45,8 @@ span.tip em {padding: 0 2px;background-color: #00ce53; color: #fff; font-size:90 div.digg {float: right;} .next-up { padding-top: 10px; font-size: 90%; } .narrow-block { width: 50%; margin: 0 auto; } -.spacer { height: 800px; } \ No newline at end of file +.spacer { height: 800px; } +#pager-demo th.remove { width: 20px; } /* pager demo */ +#pager-demo button.remove { width: 20px; height: 20px; font-size: 10px; color: #800; } +.box { width: 48%; float: left; padding: 0 1%; } +.clear { clear: both; } \ No newline at end of file diff --git a/docs/example-pager.html b/docs/example-pager.html index ceeca442..200b8073 100644 --- a/docs/example-pager.html +++ b/docs/example-pager.html @@ -34,17 +34,52 @@ - +

Author: Christian Bach
- Version: 2.0.21.1 (forked from version 2.0.5, changelog)
+ Version: 2.0.22 (forked from version 2.0.5, changelog)
Licence: Dual licensed under MIT or GPL licenses. @@ -287,54 +287,78 @@ run these samples, just like you and your users will need Javascript enabled to use tablesorter.

- Basic +
+

Basic

+

Sorting

- Metadata - setting inline options + +

Parsers / Extracting Content

- Advanced + +

Widgets / Plugins

+ +
+ + +
+

Configuration

diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 0e111afd..268b9c9b 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,6 +1,6 @@ /* * TableSorter 2.0 - Client-side table sorting with ease! -* Version 2.0.21 +* Version 2.0.22 * @requires jQuery v1.2.3 * * Copyright (c) 2007 Christian Bach @@ -300,7 +300,8 @@ for (i = 0; i < totalRows; i++) { pos = n[i][checkCell]; rows.push(r[pos]); - if (!c.appender) { + // removeRows used by the pager plugin + if (!c.appender || !c.removeRows) { l = r[pos].length; for (j = 0; j < l; j++) { table.tBodies[0].appendChild(r[pos][j]); diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 8634abff..cbbd8c03 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,7 +1,8 @@ /* * TableSorter 2.0 - Client-side table sorting with ease! -* Version 2.0.21 Minified using http://dean.edwards.name/packer/ +* Version 2.0.22 Minified using http://dean.edwards.name/packer/ * Copyright (c) 2007 Christian Bach */ -(function($){$.extend({tablesorter:new function(){var g=[],widgets=[],tbl;this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:false,textExtraction:"simple",parsers:{},widgets:[],widgetZebra:{css:["even","odd"]},headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"us",onRenderHeader:null,selectorHeaders:'thead th',tableClass:'tablesorter',debug:false};function log(s){if(typeof console!=="undefined"&&typeof console.debug!=="undefined"){console.log(s)}else{alert(s)}}function benchmark(s,d){log(s+","+(new Date().getTime()-d.getTime())+"ms")}this.benchmark=benchmark;function getElementText(a,b,c){var d="",te=a.textExtraction;if(!b){return""}if(!a.supportsTextContent){a.supportsTextContent=b.textContent||false}if(te==="simple"){if(a.supportsTextContent){d=b.textContent}else{if(b.childNodes[0]&&b.childNodes[0].hasChildNodes()){d=b.childNodes[0].innerHTML}else{d=b.innerHTML}}}else{if(typeof(te)==="function"){d=te(b)}else if(typeof(te)==="object"&&te.hasOwnProperty(c)){d=te[c](b)}else{d=$(b).text()}}return d}function getParserById(a){var i,l=g.length;for(i=0;i").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a));this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).is('.sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this});if(c.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i');$("tr:first td",a.tBodies[0]).each(function(){c.append($('').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;ib)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(a===''){return(d||0)*Number.MAX_VALUE}if(b){var i,l=a.length,n=b+d;for(i=0;i0){c.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a));this.count=this.order;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).is('.sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this});if(c.debug){benchmark("Built headers:",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i');$("tr:first td",a.tBodies[0]).each(function(){c.append($('').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;ib)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(a===''){return(d||0)*Number.MAX_VALUE}if(b){var i,l=a.length,n=b+d;for(i=0;i0){c.trigger("sorton",[config.sortList])}applyWidget(this)})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i