mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Merge branch 'master' of github.com:Mottie/tablesorter
This commit is contained in:
commit
472b5a418a
@ -29,6 +29,8 @@
|
|||||||
ajaxObject: {
|
ajaxObject: {
|
||||||
dataType: 'json'
|
dataType: 'json'
|
||||||
},
|
},
|
||||||
|
|
||||||
|
ajaxCounter: 0,
|
||||||
|
|
||||||
// process ajax so that the following information is returned:
|
// process ajax so that the following information is returned:
|
||||||
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
|
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
|
||||||
@ -349,8 +351,17 @@
|
|||||||
renderAjax(null, table, p, xhr, exception);
|
renderAjax(null, table, p, xhr, exception);
|
||||||
$doc.unbind('ajaxError.pager');
|
$doc.unbind('ajaxError.pager');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var counter = ++p.ajaxCounter;
|
||||||
|
|
||||||
p.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
|
p.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
|
||||||
p.ajaxObject.success = function(data) {
|
p.ajaxObject.success = function(data)
|
||||||
|
{
|
||||||
|
// Refuse to process old ajax commands that were overwritten by new ones
|
||||||
|
if(counter != p.ajaxCounter){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
renderAjax(data, table, p);
|
renderAjax(data, table, p);
|
||||||
$doc.unbind('ajaxError.pager');
|
$doc.unbind('ajaxError.pager');
|
||||||
if (typeof p.oldAjaxSuccess === 'function') {
|
if (typeof p.oldAjaxSuccess === 'function') {
|
||||||
|
Loading…
Reference in New Issue
Block a user