diff --git a/js/api/api.draw.js b/js/api/api.draw.js index 312df3514..55f57dcd7 100644 --- a/js/api/api.draw.js +++ b/js/api/api.draw.js @@ -8,6 +8,11 @@ _api_register( 'draw()', function ( paging ) { if ( paging === 'page' ) { _fnDraw( settings ); } + // To update the data without re-sorting, re-filtering, or changing the page, the hold-order option was added. + // This sets the ignoreSortAndFilter falg on _fnReDraw. + else if (paging === 'hold-order') { + _fnReDraw(settings, true, true); + } else { if ( typeof paging === 'string' ) { paging = paging === 'full-hold' ? diff --git a/js/core/core.draw.js b/js/core/core.draw.js index a175fc6a1..e9cc33f49 100644 --- a/js/core/core.draw.js +++ b/js/core/core.draw.js @@ -449,14 +449,16 @@ function _fnDraw( oSettings ) * @param {object} oSettings dataTables settings object * @param {boolean} [holdPosition] Keep the current paging position. By default * the paging is reset to the first page + * @param {boolean} [ignoreSortAndFilter] Keep the rows as they are rather than + * resorting and filtering based on the table settings * @memberof DataTable#oApi */ -function _fnReDraw( settings, holdPosition ) +function _fnReDraw( settings, holdPosition, ignoreSortAndFilter ) { var features = settings.oFeatures, - sort = features.bSort, - filter = features.bFilter; + sort = ignoreSortAndFilter === true ? false : features.bSort, + filter = ignoreSortAndFilter === true ? false : features.bFilter; if ( sort ) { _fnSort( settings );