Merge pull request #5908 from vvlladd28/bug/persistent-page-link/page-mode
[3.3.3] UI: Fixed persistent page link not correct init in pageMode disable
This commit is contained in:
commit
275fda0a37
@ -217,12 +217,19 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
||||
const routerQueryParams: PageQueryParam = this.route.snapshot.queryParams;
|
||||
|
||||
let sortOrder: SortOrder = null;
|
||||
if (this.pageMode) {
|
||||
if (this.entitiesTableConfig.defaultSortOrder || routerQueryParams.hasOwnProperty('direction') || routerQueryParams.hasOwnProperty('property')) {
|
||||
sortOrder = {
|
||||
property: routerQueryParams?.property || this.entitiesTableConfig.defaultSortOrder.property,
|
||||
direction: routerQueryParams?.direction || this.entitiesTableConfig.defaultSortOrder.direction
|
||||
};
|
||||
}
|
||||
} else if (this.entitiesTableConfig.defaultSortOrder){
|
||||
sortOrder = {
|
||||
property: this.entitiesTableConfig.defaultSortOrder.property,
|
||||
direction: this.entitiesTableConfig.defaultSortOrder.direction
|
||||
};
|
||||
}
|
||||
|
||||
this.displayPagination = this.entitiesTableConfig.displayPagination;
|
||||
this.defaultPageSize = this.entitiesTableConfig.defaultPageSize;
|
||||
@ -238,6 +245,7 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
||||
this.pageLink = new PageLink(10, 0, null, sortOrder);
|
||||
}
|
||||
this.pageLink.pageSize = this.displayPagination ? this.defaultPageSize : MAX_SAFE_PAGE_SIZE;
|
||||
if (this.pageMode) {
|
||||
if (routerQueryParams.hasOwnProperty('page')) {
|
||||
this.pageLink.page = Number(routerQueryParams.page);
|
||||
}
|
||||
@ -248,6 +256,7 @@ export class EntitiesTableComponent extends PageComponent implements IEntitiesTa
|
||||
this.textSearchMode = true;
|
||||
this.pageLink.textSearch = decodeURI(routerQueryParams.textSearch);
|
||||
}
|
||||
}
|
||||
this.dataSource = this.entitiesTableConfig.dataSource(this.dataLoaded.bind(this));
|
||||
if (this.entitiesTableConfig.onLoadAction) {
|
||||
this.entitiesTableConfig.onLoadAction(this.route);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user