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) => {
|
_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);
|
const url = new URL(getLocalStorageParameter('currentTableUrl') || window.location.href);
|
||||||
url.searchParams.set(pagesizeParamKey, event.target.value);
|
const formData = new FormData(this._pagesizeForm);
|
||||||
url.searchParams.set(pageParamKey, 0);
|
|
||||||
|
|
||||||
if (paginationParamEl) {
|
for (var k of url.searchParams.keys()) {
|
||||||
const encodedValue = encodeURIComponent(paginationParamEl.value);
|
url.searchParams.delete(k);
|
||||||
url.searchParams.set(paginationParamKey, encodedValue);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (var kv of formData.entries()) {
|
||||||
|
url.searchParams.append(kv[0], kv[1]);
|
||||||
|
}
|
||||||
|
|
||||||
this._updateTableFrom(url.href);
|
this._updateTableFrom(url.href);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user