From f7065b99ee73c5812e29df6be5790ffa64bab18f Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 21 May 2020 09:47:21 +0000 Subject: [PATCH] Fix: Protect against draw being 0 https://datatables.net/forums/discussion/61529/question-about-serverside-draw-parameter#latest --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 2 +- media/js/jquery.dataTables.min.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index c0cff347..238b51b8 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -54a07e325d9177beb509f319fee65ec15ed74790 +f718d43dbe61364b2dc158ff3b04933b202f999f diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 17d18682..8c0f5518 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -4112,7 +4112,7 @@ var recordsTotal = compat( 'iTotalRecords', 'recordsTotal' ); var recordsFiltered = compat( 'iTotalDisplayRecords', 'recordsFiltered' ); - if ( draw ) { + if ( draw !== undefined ) { // Protect against out of sequence returns if ( draw*1 < settings.iDraw ) { return; diff --git a/media/js/jquery.dataTables.min.js b/media/js/jquery.dataTables.min.js index c11a705c..613f6feb 100644 --- a/media/js/jquery.dataTables.min.js +++ b/media/js/jquery.dataTables.min.js @@ -50,8 +50,8 @@ h.data){var l=h.data;var m="function"===typeof l?l(b,a):l;b="function"===typeof a.sAjaxSource,f.map(b,function(a,b){return{name:b,value:a}}),k,a):a.sAjaxSource||"string"===typeof h?a.jqXHR=f.ajax(f.extend(m,{url:h||a.sAjaxSource})):"function"===typeof h?a.jqXHR=h.call(g,b,k,a):(a.jqXHR=f.ajax(f.extend(m,h)),h.data=l)}function pb(a){return a.bAjaxDataGet?(a.iDraw++,J(a,!0),ua(a,yb(a),function(b){zb(a,b)}),!1):!0}function yb(a){var b=a.aoColumns,c=b.length,d=a.oFeatures,e=a.oPreviousSearch,h=a.aoPreSearchCols,g=[],k=X(a);var l=a._iDisplayStart;var m=!1!==d.bPaginate?a._iDisplayLength: -1;var p=function(a,b){g.push({name:a,value:b})};p("sEcho",a.iDraw);p("iColumns",c);p("sColumns",K(b,"sName").join(","));p("iDisplayStart",l);p("iDisplayLength",m);var n={draw:a.iDraw,columns:[],order:[],start:l,length:m,search:{value:e.sSearch,regex:e.bRegex}};for(l=0;l',k=d.sSearch;k=k.match(/_INPUT_/)?k.replace("_INPUT_",g):k+g;b=f("
",{id:h.f?null:c+"_filter","class":b.sFilter}).append(f("