mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-19 17:54:14 +01:00
Fix examples: Pipelining - incorrect display if Ajax data retrieved and page not at the start of the retrieved block
* See thread 21402 for more information
This commit is contained in:
parent
3fd28eba98
commit
9243418e5f
@ -1 +1 @@
|
||||
f579ac0e66e86bfa4caf54e0efcff2fbbfb2cb7f
|
||||
76ef32a314724b130e507b9a1c1d1dbdd9fed9d4
|
||||
|
@ -41,6 +41,7 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
||||
return function ( request, drawCallback, settings ) {
|
||||
var ajax = false;
|
||||
var requestStart = request.start;
|
||||
var drawStart = request.start;
|
||||
var requestLength = request.length;
|
||||
var requestEnd = requestStart + requestLength;
|
||||
|
||||
@ -104,8 +105,8 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
||||
"success": function ( json ) {
|
||||
cacheLastJson = $.extend(true, {}, json);
|
||||
|
||||
if ( cacheLower != requestStart ) {
|
||||
json.data.splice( 0, requestStart-cacheLower );
|
||||
if ( cacheLower != drawStart ) {
|
||||
json.data.splice( 0, drawStart-cacheLower );
|
||||
}
|
||||
json.data.splice( requestLength, json.data.length );
|
||||
|
||||
@ -232,6 +233,7 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
||||
return function ( request, drawCallback, settings ) {
|
||||
var ajax = false;
|
||||
var requestStart = request.start;
|
||||
var drawStart = request.start;
|
||||
var requestLength = request.length;
|
||||
var requestEnd = requestStart + requestLength;
|
||||
|
||||
@ -295,8 +297,8 @@ $.fn.dataTable.pipeline = function ( opts ) {
|
||||
"success": function ( json ) {
|
||||
cacheLastJson = $.extend(true, {}, json);
|
||||
|
||||
if ( cacheLower != requestStart ) {
|
||||
json.data.splice( 0, requestStart-cacheLower );
|
||||
if ( cacheLower != drawStart ) {
|
||||
json.data.splice( 0, drawStart-cacheLower );
|
||||
}
|
||||
json.data.splice( requestLength, json.data.length );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user