fix(fe-async-table): Emulate no-js behaviour when handling pagesize
This commit is contained in:
parent
09e681eeb1
commit
28dcc8dc37
@ -297,19 +297,17 @@ export class AsyncTable {
|
||||
}
|
||||
|
||||
_changePagesizeHandler = (event) => {
|
||||
const paginationParamKey = this._asyncTableId + '-pagination';
|
||||
const pagesizeParamKey = this._asyncTableId + '-pagesize';
|
||||
const pageParamKey = this._asyncTableId + '-page';
|
||||
|
||||
const paginationParamEl = this._pagesizeForm.querySelector('[name="' + paginationParamKey + '"]');
|
||||
const url = new URL(getLocalStorageParameter('currentTableUrl') || window.location.href);
|
||||
url.searchParams.set(pagesizeParamKey, event.target.value);
|
||||
url.searchParams.set(pageParamKey, 0);
|
||||
const formData = new FormData(this._pagesizeForm);
|
||||
|
||||
if (paginationParamEl) {
|
||||
const encodedValue = encodeURIComponent(paginationParamEl.value);
|
||||
url.searchParams.set(paginationParamKey, encodedValue);
|
||||
for (var k of url.searchParams.keys()) {
|
||||
url.searchParams.delete(k);
|
||||
}
|
||||
|
||||
for (var kv of formData.entries()) {
|
||||
url.searchParams.append(kv[0], kv[1]);
|
||||
}
|
||||
|
||||
this._updateTableFrom(url.href);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user