PageResize: delay initial call to _size until table is fully initialized

pull/549/head
Joost Molenkamp 2 years ago
parent bb13b174d0
commit a9f1ba1c0b

@ -98,7 +98,15 @@ var PageResize = function ( dt, pageResizeManualDelta )
dt.on('destroy.pageResize', onDestroy); dt.on('destroy.pageResize', onDestroy);
this._attach(); this._attach();
// Delay the initial sizing until the table is fully initialized
// such that the pagination element is also added and can be taken
// into account.
var initEvent = 'init.pageResize';
dt.on(initEvent, function () {
dt.off(initEvent);
this._size(); this._size();
}.bind(this));
}; };

Loading…
Cancel
Save