mirror of
https://github.com/Mottie/tablesorter.git
synced 2025-01-12 15:24:21 +00:00
Add pager processAjaxOnInit option. Fixes #424
This commit is contained in:
parent
eb13fb4b14
commit
161c2ad99d
@ -30,6 +30,9 @@
|
||||
dataType: 'json'
|
||||
},
|
||||
|
||||
// set this to false if you want to block ajax loading on init
|
||||
processAjaxOnInit: true,
|
||||
|
||||
// process ajax so that the following information is returned:
|
||||
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
|
||||
// example:
|
||||
@ -290,7 +293,7 @@
|
||||
tds += '</tr>';
|
||||
}
|
||||
// add rows to first tbody
|
||||
c.$tbodies.eq(0).html( tds );
|
||||
p.processAjaxOnInit ? c.$tbodies.eq(0).html( tds ) : p.processAjaxOnInit = true;
|
||||
}
|
||||
// only add new header text if the length matches
|
||||
if ( th && th.length === hl ) {
|
||||
|
@ -2754,6 +2754,16 @@ $.extend($.tablesorter.themes.jui, {
|
||||
<td><a href="example-pager-ajax.html">Example</a></td>
|
||||
</tr>
|
||||
|
||||
<tr id="pager-processajaxoninit">
|
||||
<td><span class="permalink">processAjaxOnInit</span></td>
|
||||
<td>Boolean</td>
|
||||
<td>true</td>
|
||||
<td>
|
||||
Set this option to <code>false</code> if your table data is preloaded into the table, but you are still using ajax (<span class="version">v2.14.5</span>).
|
||||
</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
<tr id="pager-ajaxprocessing">
|
||||
<td><a href="#" class="permalink">ajaxProcessing</a></td>
|
||||
<td>Function</td>
|
||||
|
@ -54,6 +54,9 @@ ts.addWidget({
|
||||
dataType: 'json'
|
||||
},
|
||||
|
||||
// set this to false if you want to block ajax loading on init
|
||||
pager_processAjaxOnInit: true,
|
||||
|
||||
// process ajax so that the following information is returned:
|
||||
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
|
||||
// example:
|
||||
@ -476,7 +479,7 @@ tsp = ts.pager = {
|
||||
tds += '</tr>';
|
||||
}
|
||||
// add rows to first tbody
|
||||
c.$tbodies.eq(0).html( tds );
|
||||
wo.pager_processAjaxOnInit ? c.$tbodies.eq(0).html( tds ) : wo.pager_processAjaxOnInit = true;
|
||||
}
|
||||
// only add new header text if the length matches
|
||||
if ( th && th.length === hl ) {
|
||||
|
Loading…
Reference in New Issue
Block a user