Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions js/api/api.draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ?
Expand Down
8 changes: 5 additions & 3 deletions js/core/core.draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down