FixedColumns resets pagination (State saving)
FixedColumns resets pagination (State saving)
Hello guys,
I'm using DataTables 1.10.2 with server-side processing, state saving and FixedColumn plugin.
It took me a while to see that FixedColumn plugin was responsible for reseting my pagination losing the data saved in state saving.
I havent found any information on the subject, so I'm doing this post to help if someone encounters int the same situation.
The way i found to fix was changing the line 562 of fixedcolumns plugin:
from:
this.s.dt.oInstance.fnDraw (false);
to:
this.s.dt.oInstance.fnDraw (true);
calls:
* Redraw the table
* @ Param {bool} [complete = true] Re-filter and resort (if enabled) the table before the draw.
this.fnDraw = function (complete)
{
// Que Note this is not an exact match to the old call to _fnDraw - it takes
// Into account the new data, but can old position.
this.api (true) .Draw (complete!);
};
Which then calls with resetPaging = false
_api_register ('draw ()', function (resetPaging) {
this.iterator return ('table', function (settings) {
_fnReDraw (settings, resetPaging === false);
});
});
I would like to know if there is any other way to use fixedcolumns and keep my pagination (state saving)? (without changing the library)
Thx
Replies
Yeap! Catched that bug too. Thanks for sharing the solution, let's hope it will be fixed soon
This was an issue for me as well. Thanks for the workaround!
This is actually an error in the legacy API operation of DataTables - I committed a fix for it a few days back and that fix is currently available in the nightly.
It will be released in 1.10.6.
Thanks,
Allan
Excellent, thanks so much Allen!