diff --git a/docs/index.html b/docs/index.html index 435d3d22..15520659 100644 --- a/docs/index.html +++ b/docs/index.html @@ -868,7 +868,7 @@ null An object of instructions for per-"header cell" controls in the format: headers: { 0: { option: setting }, ... } - docs updated (v2.17.1) + (v2.17.1) docs updated

For example, to disable sorting on the first two columns of a table: headers: { 0: { sorter: false}, 1: {sorter: false} }.
@@ -2934,6 +2934,8 @@ $.extend($.tablesorter.themes.jui, { Target your one or more pager markup blocks by setting this option with a jQuery selector.
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.container; additionally you can change the class name that is applied to the pager (used within the jquery.tablesorter.pager.css file) by modifying the widgetOption.pager_css.container class name (default is "tablesorter-pager")

This is some example pager markup. It should contain all of the controls set by the multiple css-named options:
 <div class="pager">
@@ -2972,6 +2974,8 @@ $.extend($.tablesorter.themes.jui, {
 					Set this option to include a url template to use so that the pager plugin can interact with your database (v2.1; v2.9).
 					

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_ajaxUrl
+
The tags within the ajaxUrl string are optional. If do not want the user to change the page size, then you only need to include the page in this string:
ajaxUrl: "http://mydatabase.com?start={page}"
If you need to send your server a page offset (actual starting record number), then you'll need to use the customAjaxUrl option.
@@ -3020,9 +3024,11 @@ $.extend($.tablesorter.themes.jui, { Function function(table, url) { return url; } - This callback function allows you to modify the processed URL as desired docs updated (v2.8.1). + This callback function allows you to modify the processed URL as desired (v2.8.1) docs updated.

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_customAjaxUrl
+
The customAjaxUrl function has two parameters, the table DOM element and the processed url string (all tags within the ajaxUrl have been replaced with their appropriate values).
$(function(){
   $("table")
@@ -3073,6 +3079,8 @@ $.extend($.tablesorter.themes.jui, {
 					This option contains the ajax settings for the pager interaction with your database (v2.10).
 					

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_ajaxObject
+
The ajaxObject is completely customizable, except for the `url` setting which is processed using the pager's `ajaxUrl` and `customAjaxUrl` options.

Your server does not need to return a JSON format, if you want to return pure HTML, set the dataType to "html" and modify the ajaxProcessing function to instead work with HTML; then return a jQuery object or apply the HTML to the table yourself.
@@ -3099,11 +3107,15 @@ $.extend($.tablesorter.themes.jui, { - processAjaxOnInit + Boolean true Set this option to false if your table data is preloaded into the table, but you are still using ajax (v2.14.5). +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_processAjaxOnInit +
@@ -3116,6 +3128,8 @@ $.extend($.tablesorter.themes.jui, { This function is required to return the ajax data obtained from your server into a useable format for tablesorter to apply to the table (v2.1, v2.17.3).

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_ajaxProcessing
+
This function was created and modified to allow you a great deal of flexibility. The only required information that this function needs to return is an array containing the total number of rows, which is needed to calculate total pages.

There are numerous examples below. Choosing which one to use is left to you. For more information, please check out related questions on Stackoverflow, in particular see this thread about how to use the different ajax options together.
@@ -3323,7 +3337,10 @@ $.extend($.tablesorter.themes.jui, { String "{page}/{totalPages}" - This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9).
+ This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9). +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_output

This option replaced the original separator option, which only separated the page number from the total number of pages. The formatted output from this option is placed inside the information block targeted by the cssPageDisplay option.

@@ -3367,48 +3384,80 @@ $.extend($.tablesorter.themes.jui, { If true, the addon hides the left pager arrow on the first page and right pager arrow on the last page.

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_updateArrows
+
If true the classname from the cssDisabled option is applied to the arrows when at either page extreme.
Example - page + Numeric 0 - Set the starting page of the pager (zero-based index). + + Set the starting page of the pager (zero-based index). +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_startPage +
+ Example - pageReset + Numeric, Boolean 0 - Reset pager to this page after filtering; set to desired page number (zero-based index), or false to not change page at filter start (v2.16). + + Reset pager to this page after filtering; set to desired page number (zero-based index), or false to not change page at filter start (v2.16). +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_pageReset +
+ - size + Numeric 10 - Set initial number of visible rows. This value is changed by the dropdown selector targeted by the cssPageSize option. + + Set initial number of visible rows. This value is changed by the dropdown selector targeted by the cssPageSize option. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_size +
+ Example - savePages + Boolean true - Saves the current pager page size and number. This option requires the $.tablesorter.storage script in the jquery.tablesorter.widgets.js file (v2.11). + + Saves the current pager page size and number. This option requires the $.tablesorter.storage script in the jquery.tablesorter.widgets.js file (v2.11). +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_savePages +
+ Example - storageKey + String "tablesorter-pager" - Saves tablesorter paging to custom key if defined. Key parameter name used by the $.tablesorter.storage function. Useful if you have multiple tables defined (v2.15) + + Saves tablesorter paging to custom key if defined. Key parameter name used by the $.tablesorter.storage function. Useful if you have multiple tables defined (v2.15) +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_storageKey +
+ Example @@ -3419,6 +3468,8 @@ $.extend($.tablesorter.themes.jui, { Maintain the height of the table even when fewer than the set number of records is shown (v2.1; updated 2.7.1).

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_fixedHeight
+
This option replaced the original positionFixed and offset options which set the absolute position of the pager block.

If true, it should maintain the height of the table, even when viewing fewer than the set number of records (go to the last page of any demo to see this in action). It works by adding an empty row to make up the differences in height. @@ -3435,6 +3486,8 @@ $.extend($.tablesorter.themes.jui, { If true, child rows will be counted towards the pager set size (v2.13).

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_countChildRows
+
*CAUTION* When true, child row(s) may not appear to be attached to its parent row, may be split across pages or may distort the table if rowspan or cellspans are included within the child row.

@@ -3452,6 +3505,8 @@ $.extend($.tablesorter.themes.jui, { If true, rows are removed from the table to speed up the sort of large tables (v2.0.21).

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_removeRows
+
The original tablesorter plugin (v2.0.5) removed rows automatically, without providing an option. It really does speed up sorting of very large tables, but also breaks updating and modifying table content dynamically.

If this option is false, the addon only hides the non-visible rows; this is useful if you plan to add/remove rows with the pager enabled. @@ -3461,34 +3516,58 @@ $.extend($.tablesorter.themes.jui, { - cssFirst + String ".first" - This option contains a jQuery selector string pointing to the go to first page arrow. See container for full HTML. + + This option contains a jQuery selector string pointing to the go to first page arrow. See container for full HTML. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.first +
+ Example - cssPrev + String ".prev" - This option contains a jQuery selector string pointing to the go to previous page arrow. See container for full HTML. + + This option contains a jQuery selector string pointing to the go to previous page arrow. See container for full HTML. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.prev +
+ Example - cssNext + String ".next" - This option contains a jQuery selector string pointing to the go to next page arrow. See container for full HTML. + + This option contains a jQuery selector string pointing to the go to next page arrow. See container for full HTML. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.next +
+ Example - cssLast + String ".last" - This option contains a jQuery selector string pointing to the go to last page arrow. See container for full HTML. + + This option contains a jQuery selector string pointing to the go to last page arrow. See container for full HTML. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.last +
+ Example @@ -3496,9 +3575,11 @@ $.extend($.tablesorter.themes.jui, { String ".gotoPage" - This option contains a jQuery selector string pointing to the page select dropdown. See container for full HTML (v2.4) + This option contains a jQuery selector string pointing to the page select dropdown. See container for full HTML (v2.4; v2.17.3)

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.gotoPage (changed from goto in v2.17.3)
+
Please note that this select dropdown is initially empty and automatically updated by the plugin with the correct number of pages, which depends on the size setting.
@@ -3512,6 +3593,8 @@ $.extend($.tablesorter.themes.jui, { This option contains a jQuery selector string pointing to the output element (v2.0.9)

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.pageDisplay
+
In the original tablesorter (v2.0.5) this option could only target an input, it was updated (v2.0.9) to display the formatted output from the output option inside of any element (span, div or input).
@@ -3519,10 +3602,16 @@ $.extend($.tablesorter.themes.jui, { - cssPageSize + String ".pagesize" - This option contains a jQuery selector string pointing to the page size selector. See container for full HTML. + + This option contains a jQuery selector string pointing to the page size selector. See container for full HTML. +
+
+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_selectors.pageSize +
+ Example @@ -3533,6 +3622,8 @@ $.extend($.tablesorter.themes.jui, { This option contains the class name that is applied to the error information row that is added inside the pager with any ajax exceptions.

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_css.errorRow
+
Note there is no period "." in front of this class name (it is not a selector).
@@ -3545,6 +3636,8 @@ $.extend($.tablesorter.themes.jui, { This option contains the class name that is applied to disabled pager controls.

+ Note The pager widget equivalent option is within the widgetOptions and accessed via widgetOptions.pager_css.disabled
+
More explicitly, this class is applied to the pager arrows when they are at either extreme of pages and the updateArrows option is true. When the pager has been disabled, this class is applied to all controls.

Note there is no period "." in front of this class name (it is not a selector). diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index 2198a39e..a57628b9 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -93,7 +93,7 @@ ts.addWidget({ prev : '.prev', // previous page arrow next : '.next', // next page arrow last : '.last', // go to last page arrow - goto : '.gotoPage', // go to page selector - select dropdown that sets the current page + gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page pageDisplay : '.pagedisplay', // location of where the "output" is displayed pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option } @@ -150,7 +150,7 @@ tsp = ts.pager = { // added in case the pager is reinitialized after being destroyed. p.$container = $(s.container).addClass(wo.pager_css.container).show(); // goto selector - p.$goto = p.$container.find(s.goto); + p.$goto = p.$container.find(s.gotoPage); // goto is a reserved word #657 // page size selector p.$size = p.$container.find(s.pageSize); p.totalRows = c.$tbodies.eq(0).children('tr').length;