Pager: update widget to also pass jqxhr to ajaxProcessing. See #626

This commit is contained in:
Mottie 2014-05-26 17:08:41 -05:00
parent f7f6efcb78
commit d2eb430d2b

View File

@ -480,7 +480,7 @@ tsp = ts.pager = {
var i, j, t, hsh, $f, $sh, th, d, l, rr_count,
$t = c.$table,
tds = '',
result = wo.pager_ajaxProcessing(data, table) || [ 0, [] ],
result = wo.pager_ajaxProcessing(data, table, xhr) || [ 0, [] ],
hl = $t.find('thead th').length;
// Clean up any previous error.
@ -597,12 +597,12 @@ tsp = ts.pager = {
});
counter = ++p.ajaxCounter;
wo.pager_ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
wo.pager_ajaxObject.success = function(data) {
wo.pager_ajaxObject.success = function(data, status, jqxhr) {
// Refuse to process old ajax commands that were overwritten by new ones - see #443
if (counter < p.ajaxCounter){
return;
}
tsp.renderAjax(data, table, c);
tsp.renderAjax(data, table, c, jqxhr);
$doc.unbind('ajaxError.pager');
if (typeof p.oldAjaxSuccess === 'function') {
p.oldAjaxSuccess(data);
@ -682,7 +682,7 @@ tsp = ts.pager = {
// if filtered, start from zero
index = f ? 0 : s;
count = f ? 0 : s;
added = 0;
added = 0;
while (added < e && index < rows.length) {
if (!f || !/filtered/.test(rows[index][0].className)){
count++;