+
Complex can be slow in large tables so consider writing your own text extraction function "myTextExtraction" which you define like:
var myTextExtraction = function(node){
// extract data from markup and return it
@@ -742,10 +743,11 @@ $(function(){
widgetZebra |
Object with Array |
- {css:["even","odd"]} |
+ { css: [ "even", "odd" ] } |
When the zebra striping widget is initialized, it automatically applied the default class names of "even" and "odd" .
+
Use the "widgetZebra" option to change the css class name as follows:
$(function(){
$("table").tablesorter({
@@ -760,10 +762,11 @@ $(function(){
widgetColumns |
Object with Array |
- {css:[ "primary", "secondary", "tertiary" ]} |
+ { css:[ "primary", "secondary", "tertiary" ] } |
When the column styling widget is initialized, it automatically applied the default class names of "primary" for the primary sort, "secondary" for the next sort, "tertiary" for the next sort, and so on (add more as needed)... New! in v2.0.17.
+
Use the "widgetColumns" option to change the css class name as follows:
$(function(){
$("table").tablesorter({
@@ -775,6 +778,25 @@ $(function(){
Example |
|
+
+ widgetUitheme |
+ Object with Array |
+ { css: ["ui-icon-arrowthick-2-n-s", "ui-icon-arrowthick-1-s", "ui-icon-arrowthick-1-n"] } |
+
+ Used when the ui theme styling widget is initialized. It automatically applies the default class names of "ui-icon-arrowthick-2-n-s" for the unsorted column, "ui-icon-arrowthick-1-s" for the descending sort and "ui-icon-arrowthick-1-n" for the ascending sort. New! in v2.0.9.
+
+
+ Use the "widgetUitheme" option to change the css class name as follows:
+ $(function(){
+ $("table").tablesorter({
+ widgets: ["uitheme"], // initialize ui theme styling widget of the table
+ widgetUitheme: { css: ["ui-icon-carat-2-n-s", "ui-icon-carat-1-s", "ui-icon-carat-1-n"] }
+ });
+});
+ |
+ Example |
+
+
widthFixed |
Boolean |
@@ -1067,17 +1089,10 @@ $(table)
- jQuery Metadata 2.1 (3,7kb Required for setting inline options)
- jquery.tablesorter.js (31kb, for development)
- - jquery.tablesorter.pager.js (3,6kb, tablesorter pagination plugin)
- - jquery.tablesorter.widgets.js (2,12kb, includes the jQuery UI theme 'uitheme' and columns styling 'columns' widgets. New! in v2.0.17.)
+ - jquery.tablesorter.pager.js (5,6kb, tablesorter pagination plugin)
+ - jquery.tablesorter.widgets.js (4,1kb, includes the jQuery UI theme 'uitheme', columns styling 'columns' widget and row 'filter' widgets. New! in v2.0.17.)
-
-
Themes:
- Green Skin - Images and CSS styles for green themed headers
diff --git a/docs/js/chili/css.js b/docs/js/chili/css.js
index 9020715e..09cab61e 100644
--- a/docs/js/chili/css.js
+++ b/docs/js/chili/css.js
@@ -79,7 +79,7 @@ WEBSITE: http://noteslog.com/chili/
}
, color : {
_match: /(?:\#[a-fA-F0-9]{3,6})|\b(?:yellow|white|teal|silver|red|purple|olive|navy|maroon|lime|green|gray|fuchsia|blue|black|aqua|YellowGreen|Yellow|WhiteSmoke|White|Wheat|Violet|Turquoise|Tomato|Thistle|Teal|Tan|SteelBlue|SpringGreen|Snow|SlateGrey|SlateGray|SlateBlue|SkyBlue|Silver|Sienna|SeaShell|SeaGreen|SandyBrown|Salmon|SaddleBrown|RoyalBlue|RosyBrown|Red|Purple|PowderBlue|Plum|Pink|Peru|PeachPuff|PapayaWhip|PaleVioletRed|PaleTurquoise|PaleGreen|PaleGoldenRod|Orchid|OrangeRed|Orange|OliveDrab|Olive|OldLace|Navy|NavajoWhite|Moccasin|MistyRose|MintCream|MidnightBlue|MediumVioletRed|MediumTurquoise|MediumSpringGreen|MediumSlateBlue|MediumSeaGreen|MediumPurple|MediumOrchid|MediumBlue|MediumAquaMarine|Maroon|Magenta|Linen|LimeGreen|Lime|LightYellow|LightSteelBlue|LightSlateGrey|LightSlateGray|LightSkyBlue|LightSeaGreen|LightSalmon|LightPink|LightGrey|LightGreen|LightGray|LightGoldenRodYellow|LightCyan|LightCoral|LightBlue|LemonChiffon|LawnGreen|LavenderBlush|Lavender|Khaki|Ivory|Indigo|IndianRed|HotPink|HoneyDew|Grey|GreenYellow|Green|Gray|GoldenRod|Gold|GhostWhite|Gainsboro|Fuchsia|ForestGreen|FloralWhite|FireBrick|DodgerBlue|DimGrey|DimGray|DeepSkyBlue|DeepPink|Darkorange|DarkViolet|DarkTurquoise|DarkSlateGrey|DarkSlateGray|DarkSlateBlue|DarkSeaGreen|DarkSalmon|DarkRed|DarkOrchid|DarkOliveGreen|DarkMagenta|DarkKhaki|DarkGrey|DarkGreen|DarkGray|DarkGoldenRod|DarkCyan|DarkBlue|Cyan|Crimson|Cornsilk|CornflowerBlue|Coral|Chocolate|Chartreuse|CadetBlue|BurlyWood|Brown|BlueViolet|Blue|BlanchedAlmond|Black|Bisque|Beige|Azure|Aquamarine|Aqua|AntiqueWhite|AliceBlue)\b/
- , _style: "color: green;"
+ , _style: "color: navy;"
}
}
}
diff --git a/docs/js/chili/js.js b/docs/js/chili/js.js
index 31baf656..14ec8af7 100644
--- a/docs/js/chili/js.js
+++ b/docs/js/chili/js.js
@@ -19,7 +19,7 @@ WEBSITE: http://noteslog.com/chili/
}
, sl_comment: {
_match: /\/\/.*/
- , _style: 'color: green;'
+ , _style: 'color: olive;'
}
, string: {
_match: /(?:\'[^\'\\\n]*(?:\\.[^\'\\\n]*)*\')|(?:\"[^\"\\\n]*(?:\\.[^\"\\\n]*)*\")/
@@ -61,7 +61,7 @@ WEBSITE: http://noteslog.com/chili/
}
, 'function': {
_match: /\b(parseInt|parseFloat|isNaN|isFinite|eval|encodeURIComponent|encodeURI|decodeURIComponent|decodeURI)\b/
- , _style: 'color: olive;'
+ , _style: 'color: green;'
}
, operator: {
_match: /\b(void|typeof|this|new|instanceof|in|function|delete)\b/
diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js
index d2c2824e..a9ae5687 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.18
+* Version 2.0.19
* @requires jQuery v1.2.3
*
* Copyright (c) 2007 Christian Bach
@@ -94,7 +94,6 @@
parsers: {},
widgets: [],
widgetZebra: { css: ["even", "odd"] },
- widgetColumns: { css: ["primary", "secondary", "tertiary" ] },
headers: {},
widthFixed: false,
cancelSelection: true,
@@ -288,32 +287,31 @@
}
function appendToTable(table, cache) {
- var c = cache,
- r = c.row,
- n = c.normalized,
+ var c = table.config,
+ r = cache.row,
+ n = cache.normalized,
totalRows = n.length,
checkCell = totalRows ? (n[0].length - 1) : 0,
- tableBody = $(table.tBodies[0]),
rows = [],
i, j, l, pos, appendTime;
- if (table.config.debug) {
+ if (c.debug) {
appendTime = new Date();
}
for (i = 0; i < totalRows; i++) {
pos = n[i][checkCell];
rows.push(r[pos]);
- if (!table.config.appender) {
+ if (!c.appender) {
l = r[pos].length;
for (j = 0; j < l; j++) {
- tableBody[0].appendChild(r[pos][j]);
+ table.tBodies[0].appendChild(r[pos][j]);
}
}
}
- if (table.config.appender) {
- table.config.appender(table, rows);
+ if (c.appender) {
+ c.appender(table, rows);
}
rows = null;
- if (table.config.debug) {
+ if (c.debug) {
benchmark("Rebuilt table:", appendTime);
}
// apply table widgets
@@ -396,15 +394,15 @@
function buildHeaders(table) {
var meta = ($.metadata) ? true : false,
header_index = computeTableHeaderCellIndexes(table),
- $th, lock, time, $tableHeaders;
- if (table.config.debug) {
+ $th, lock, time, $tableHeaders, c = table.config;
+ c.headerList = [];
+ if (c.debug) {
time = new Date();
}
- $tableHeaders = $(table.config.selectorHeaders, table)
+ $tableHeaders = $(c.selectorHeaders, table)
.wrapInner("")
.each(function (index) {
this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
- // this.column = index;
this.order = formatSortingOrder( checkHeaderOrder(table, index) );
this.count = this.order;
if (checkHeaderMetadata(this) || checkHeaderOptions(table, index) || $(this).is('.sorter-false')) { this.sortDisabled = true; }
@@ -412,13 +410,13 @@
lock = checkHeaderLocked(table, index);
if (typeof(lock) !== 'undefined' && lock !== false) { this.order = this.lockedOrder = formatSortingOrder(lock); }
if (!this.sortDisabled) {
- $th = $(this).addClass(table.config.cssHeader);
- if (table.config.onRenderHeader) { table.config.onRenderHeader.apply($th, [index]); }
+ $th = $(this).addClass(c.cssHeader);
+ if (c.onRenderHeader) { c.onRenderHeader.apply($th, [index]); }
}
// add cell to headerList
- table.config.headerList[index] = this;
+ c.headerList[index] = this;
});
- if (table.config.debug) {
+ if (c.debug) {
benchmark("Built headers:", time);
log($tableHeaders);
}
@@ -468,9 +466,8 @@
}
function fixColumnWidth(table, $headers) {
- var c = table.config, colgroup;
- if (c.widthFixed) {
- colgroup = $('');
+ if (table.config.widthFixed) {
+ var colgroup = $('');
$("tr:first td", table.tBodies[0]).each(function () {
colgroup.append($('').css('width', $(this).width()));
});
diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js
index 1838af4e..5281c5ee 100644
--- a/js/jquery.tablesorter.min.js
+++ b/js/jquery.tablesorter.min.js
@@ -1,7 +1,7 @@
/*
* TableSorter 2.0 - Client-side table sorting with ease!
-* Version 2.0.18 Minified using http://dean.edwards.name/packer/
+* Version 2.0.19 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"]},widgetColumns:{css:["primary","secondary","tertiary"]},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(b.config.cssHeader);if(b.config.onRenderHeader){b.config.onRenderHeader.apply($th,[a])}}b.config.headerList[a]=this});if(b.config.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(){colgroup.append($('').css('width',$(this).width()))});$(a).prepend(colgroup)}}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 |