diff --git a/docs/index.html b/docs/index.html index e67270cc..6fdf5594 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2970,6 +2970,10 @@ $.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).
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.ajaxProcessing
function:
$(function(){ $("table") @@ -3035,7 +3039,26 @@ $.extend($.tablesorter.themes.jui, { return url += '&currntUrl=' + window.location.href; } }); -});
$(function(){ + $("table") + .tablesorter() + .tablesorterPager({ + ajaxUrl: "http://mydatabase.com?{sortList:col}", + customAjaxUrl: function(table, url) { + var pager = table.config.pager, + start = pager.page * pager.size, + end = start + pager.size; + return url += '&start=' + start + '&end=' + end; + }, + ajaxProcessing: function(data, table, xhr){ + // do something with the ajax data + return [ total_rows, data ]; + } + }); +});+
ajaxObject
is completely customizable, except for the `url` setting which is processed using the pager's `ajaxUrl` and `customAjaxUrl` options."html"
and modify the ajaxProcessing
function to instead work with HTML; then return a jQuery object or apply the HTML to the table yourself.$(function(){ $("table") @@ -3089,6 +3114,10 @@ $.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.14.3).
+ 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.
+
In v2.10, the returned rows is now optional. And it can either be an array of arrays or a jQuery object (not attached to the table)
Process your ajax data so that the following information is returned: