diff --git a/docs/example-pager-ajax.html b/docs/example-pager-ajax.html index 945642f9..4f0f9f7f 100644 --- a/docs/example-pager-ajax.html +++ b/docs/example-pager-ajax.html @@ -125,10 +125,15 @@ } }, - // output string - default is '{page}/{totalPages}'; possible variables: {page}, {totalPages}, {startRow}, {endRow} and {totalRows} + // Set this option to false if your table data is preloaded into the table, but you are still using ajax + processAjaxOnInit: true, + + // output string - default is '{page}/{totalPages}'; + // possible variables: {page}, {totalPages}, {startRow}, {endRow} and {totalRows} output: '{startRow} to {endRow} ({totalRows})', - // apply disabled classname to the pager arrows when the rows at either extreme is visible - default is true + // apply disabled classname (cssDisabled option) to the pager arrows when the rows + // are at either extreme is visible; default is true updateArrows: true, // starting page of the pager (zero based index) @@ -137,25 +142,43 @@ // Number of visible rows - default is 10 size: 25, - // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty - // table row set to a height to compensate; default is false + // Saves the current pager page size and number (requires storage widget) + savePages: true, + // Saves tablesorter paging to custom key if defined. + // Key parameter name used by the $.tablesorter.storage function. + // Useful if you have multiple tables defined + storageKey: 'tablesorter-pager', + + // Reset pager to this page after filtering; set to desired page number (zero-based index), + // or false to not change page at filter start + pageReset: 0, + + // if true, the table will remain the same height no matter how many records are displayed. + // The space is made up by an empty table row set to a height to compensate; default is false fixedHeight: false, // 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. + // setting this to false, only hides the non-visible rows; needed if you plan to + // add/remove rows with the pager enabled. removeRows: false, + // If true, child rows will be counted towards the pager set size + countChildRows: false, + // css class names of pager arrows cssNext : '.next', // next page arrow cssPrev : '.prev', // previous page arrow cssFirst : '.first', // go to first page arrow cssLast : '.last', // go to last page arrow + cssGoto : '.gotoPage', // page select dropdown - select dropdown that set the "page" option + cssPageDisplay : '.pagedisplay', // location of where the "output" is displayed cssPageSize : '.pagesize', // page size selector - select dropdown that sets the "size" option - cssErrorRow : 'tablesorter-errorRow', // error information row - // 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 + // class added to arrows when at the extremes; see the "updateArrows" option + // (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 + cssErrorRow : 'tablesorter-errorRow' // error information row }); diff --git a/docs/example-pager.html b/docs/example-pager.html index 732b563b..402c66cc 100644 --- a/docs/example-pager.html +++ b/docs/example-pager.html @@ -38,21 +38,23 @@ // modify the url after all processing has been applied customAjaxUrl: function(table, url) { return url; }, + // add more ajax settings here + // see http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings + ajaxObject: { dataType: 'json' }, + // process ajax so that the data object is returned along with the total number of rows - // example: { "data" : [{ "ID": 1, "Name": "Foo", "Last": "Bar" }], "total_rows" : 100 } - ajaxProcessing: function(ajax){ - if (ajax && ajax.hasOwnProperty('data')) { - // return [ "data", "total_rows" ]; - return [ ajax.total_rows, ajax.data ]; - } - }, + ajaxProcessing: null, + + // Set this option to false if your table data is preloaded into the table, but you are still using ajax + processAjaxOnInit: true, // output string - default is '{page}/{totalPages}' // possible variables: {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows} // also {page:input} & {startRow:input} will add a modifiable input in place of the value output: '{startRow:input} to {endRow} ({totalRows})', - // apply disabled classname to the pager arrows when the rows at either extreme is visible - default is true + // apply disabled classname (cssDisabled option) to the pager arrows when the rows + // are at either extreme is visible; default is true updateArrows: true, // starting page of the pager (zero based index) @@ -64,9 +66,15 @@ // Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js) savePages : true, - //defines custom storage key + // Saves tablesorter paging to custom key if defined. + // Key parameter name used by the $.tablesorter.storage function. + // Useful if you have multiple tables defined storageKey:'tablesorter-pager', + // Reset pager to this page after filtering; set to desired page number (zero-based index), + // or false to not change page at filter start + pageReset: 0, + // if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty // table row set to a height to compensate; default is false fixedHeight: true, @@ -75,6 +83,9 @@ // setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled. removeRows: false, + // If true, child rows will be counted towards the pager set size + countChildRows: false, + // css class names of pager arrows cssNext: '.next', // next page arrow cssPrev: '.prev', // previous page arrow diff --git a/docs/example-widget-filter.html b/docs/example-widget-filter.html index f766a9fd..e2cbe0a2 100644 --- a/docs/example-widget-filter.html +++ b/docs/example-widget-filter.html @@ -153,7 +153,7 @@ txt = $t.data('filter-text') || $t.text(); // text to add to filter filters[col] = txt; - // using "table.hasFilters" here to make sure we aren't targetting a sticky header + // using "table.hasFilters" here to make sure we aren't targeting a sticky header $.tablesorter.setFilters( $('#table'), filters, true ); // new v2.9 /** old method (prior to tablsorter v2.9 *** diff --git a/docs/example-widget-output.html b/docs/example-widget-output.html index 86b0e95b..a2452685 100644 --- a/docs/example-widget-output.html +++ b/docs/example-widget-output.html @@ -89,7 +89,7 @@ col = $t.data('filter-column'), // zero-based index txt = $t.data('filter-text') || $t.text(); // text to add to filter filters[col] = txt; - // using "table.hasFilters" here to make sure we aren't targetting a sticky header + // using "table.hasFilters" here to make sure we aren't targeting a sticky header $.tablesorter.setFilters( $('table.hasFilters'), filters, true ); // new v2.9 return false; }); diff --git a/docs/example-widget-resizable.html b/docs/example-widget-resizable.html index 740fb9b1..6e5fb09c 100644 --- a/docs/example-widget-resizable.html +++ b/docs/example-widget-resizable.html @@ -177,7 +177,7 @@ resizable_widths : [ '10%', '10%', '40px', '10%', '100px' ]
true
, the last column will be targetted for resizing.
+ true
, the last column will be targeted for resizing.
When true
, resizing a column will change the size of the selected column, and the last column, not the selected column's neighbor.
When false
, resizing a column will move the column border between it's neighbors.
>
to the selector in v2.3 to prevent targetting nested table headers. It was modified again in v2.4 to include td
cells within the thead.
+ >
to the selector in v2.3 to prevent targeting nested table headers. It was modified again in v2.4 to include td
cells within the thead.
true
, the last column will be targetted for resizing (v2.21.3).
+ Resizable widget: When true
, the last column will be targeted for resizing (v2.21.3).
When true
, resizing a column will change the size of the selected column, and the last column, not the selected column's neighbor.
When false
, resizing a column will move the column border between it's neighbors.
tbodyIndex
- the tbody zero-based index of the current cell.rowIndex
- the row zero-based index of the current cell.$row
- a jQuery object targetting the current row being processed.$cell
- a jQuery object targetting the curretn cell being processed.$row
- a jQuery object targeting the current row being processed.$cell
- a jQuery object targeting the curretn cell being processed.parsed
- parsed text of the current cell.raw
- raw (unparsed) text of the current cell.var table = $('table')[0]; -// targetting the 4th column (zero-based index) +// targeting the 4th column (zero-based index) $.tablesorter.getColumnText( table, 3, function( data ) { if ( data.parsed > 20 ) { data.$cell.addClass('red'); @@ -6629,7 +6629,7 @@ $.tablesorter.getColumnText( table, 3, function( data ) {If the callback isn't used, the function will return the cummulated data for the column (it does not include all of the parameters available within the callback function):
var table = $('table')[0], - // targetting the 4th column (zero-based index) + // targeting the 4th column (zero-based index) columnText = $.tablesorter.getColumnText( table, 3 ); // columnText = { // raw : [ 'cell1', 'cell2', ..., 'celln' ],