From 201cc7fb69c9866e7225156c01f31c9af9eb7af2 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Thu, 6 Aug 2015 20:42:01 +0100 Subject: [PATCH] Fix: If `dt-init deferRender` was enabled, the `dt-event init` event wouldn't trigger until after the table's second draw. - This could be seen specifically when using Responsive with a defer rendered table - Responsive wouldn't kick in until after the second draw. --- .datatables-commit-sync | 2 +- media/js/jquery.dataTables.js | 3 +- media/js/jquery.dataTables.min.js | 156 +++++++++++++++--------------- 3 files changed, 81 insertions(+), 80 deletions(-) diff --git a/.datatables-commit-sync b/.datatables-commit-sync index fdefae2d..bae9918f 100644 --- a/.datatables-commit-sync +++ b/.datatables-commit-sync @@ -1 +1 @@ -fc6d311657030d614707cc90b39208d54e74c4f5 +a4416ea499ccd9dec9156f9b14588a7c740d3e3a diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 464ddf86..b9b11a52 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -3280,6 +3280,7 @@ var i, iLen, iAjaxStart=settings.iInitDisplayStart; var columns = settings.aoColumns, column; var features = settings.oFeatures; + var deferLoading = settings.bDeferLoading; // value modified by the draw /* Ensure that the table data is fully initialised */ if ( ! settings.bInitialised ) { @@ -3321,7 +3322,7 @@ // Server-side processing init complete is done by _fnAjaxUpdateDraw var dataSrc = _fnDataSource( settings ); - if ( dataSrc != 'ssp' ) { + if ( dataSrc != 'ssp' || deferLoading ) { // if there is an ajax source load the data if ( dataSrc == 'ajax' ) { _fnBuildAjax( settings, [], function(json) { diff --git a/media/js/jquery.dataTables.min.js b/media/js/jquery.dataTables.min.js index 7fe0b037..03eec043 100644 --- a/media/js/jquery.dataTables.min.js +++ b/media/js/jquery.dataTables.min.js @@ -43,84 +43,84 @@ f=a.aiDisplayMaster,g;0!==m.ext.search.length&&(c=!0);g=yb(a);if(0>=b.length)a.a "")}function va(a){return a.replace(Xb,"\\$1")}function yb(a){var b=a.aoColumns,c,e,d,f,g,j,i,h,l=m.ext.type.search;c=!1;e=0;for(f=a.aoData.length;e",{"class":a.oClasses.sInfo,id:!c?b+"_info":null});c||(a.aoDrawCallback.push({fn:Bb,sName:"information"}),e.attr("role","status").attr("aria-live","polite"),h(a.nTable).attr("aria-describedby", b+"_info"));return e[0]}function Bb(a){var b=a.aanFeatures.i;if(0!==b.length){var c=a.oLanguage,e=a._iDisplayStart+1,d=a.fnDisplayEnd(),f=a.fnRecordsTotal(),g=a.fnRecordsDisplay(),j=g?c.sInfo:c.sInfoEmpty;g!==f&&(j+=" "+c.sInfoFiltered);j+=c.sInfoPostFix;j=Cb(a,j);c=c.fnInfoCallback;null!==c&&(j=c.call(a.oInstance,a,e,d,f,g,j));h(b).html(j)}}function Cb(a,b){var c=a.fnFormatNumber,e=a._iDisplayStart+1,d=a._iDisplayLength,f=a.fnRecordsDisplay(),g=-1===d;return b.replace(/_START_/g,c.call(a,e)).replace(/_END_/g, -c.call(a,a.fnDisplayEnd())).replace(/_MAX_/g,c.call(a,a.fnRecordsTotal())).replace(/_TOTAL_/g,c.call(a,f)).replace(/_PAGE_/g,c.call(a,g?1:Math.ceil(e/d))).replace(/_PAGES_/g,c.call(a,g?1:Math.ceil(f/d)))}function ha(a){var b,c,e=a.iInitDisplayStart,d=a.aoColumns,f;c=a.oFeatures;if(a.bInitialised){mb(a);jb(a);fa(a,a.aoHeader);fa(a,a.aoFooter);C(a,!0);c.bAutoWidth&&Ha(a);b=0;for(c=d.length;b",{name:c+"_length","aria-controls":c, -"class":b.sLengthSelect}),g=0,j=f.length;g