N°4230 - Printable version issues

This commit is contained in:
acognet
2021-09-29 10:54:33 +02:00
parent 8dbbc9a124
commit e2904fb0ee
9 changed files with 108 additions and 77 deletions

View File

@@ -46,14 +46,6 @@ $.fn.dataTable.pipeline = function (opts, initJson) {
}
var requestEnd = requestStart+requestLength;
//Manage case requestLength=-1 => all the row are display
if (requestLength == -1) {
requestLength = cacheLastJson.recordsTotal;
if (cacheLower != 0 || cacheLastJson.recordsTotal > cacheUpper) {
//new server request is mandatory
ajax = true;
}
}
if (request.draw == 1 && initJson != null) {
//do nothing
cacheLastJson = $.extend(true, {}, initJson);
@@ -76,15 +68,24 @@ $.fn.dataTable.pipeline = function (opts, initJson) {
ajax = true;
}
//Manage case requestLength=-1 => all the row are display
if (requestLength == -1) {
requestLength = cacheLastJson.recordsTotal;
if (cacheLower != 0 || cacheLastJson.recordsTotal > cacheUpper) {
//new server request is mandatory
ajax = true;
}
}
// Store the request for checking next time around
cacheLastRequest = $.extend( true, {}, request );
cacheLastRequest = $.extend(true, {}, request);
if ( ajax ) {
if (ajax) {
// Need data from the server
if ( requestStart < cacheLower ) {
requestStart = requestStart - (requestLength*(conf.pages-1));
if (requestStart < cacheLower) {
requestStart = requestStart-(requestLength * (conf.pages-1));
if ( requestStart < 0 ) {
if (requestStart < 0) {
requestStart = 0;
}
}