link selectOrderBy

This commit is contained in:
Yuri Kuznetsov
2024-01-10 15:26:30 +02:00
parent 9cee152e23
commit e12e7ec95a
2 changed files with 28 additions and 5 deletions
+20
View File
@@ -543,6 +543,15 @@ class LinkFieldView extends BaseFieldView {
url += '&' + $.param({'where': filters.advanced});
}
if (this.panelDefs.selectOrderBy) {
const direction = this.panelDefs.selectOrderDirection || 'asc';
url += '&' + $.param({
orderBy: this.panelDefs.selectOrderBy,
order: direction,
});
}
resolve(url);
});
});
@@ -563,6 +572,15 @@ class LinkFieldView extends BaseFieldView {
url += '&' + $.param({'primaryFilter': primary});
}
if (this.panelDefs.selectOrderBy) {
const direction = this.panelDefs.selectOrderDirection || 'asc';
url += '&' + $.param({
orderBy: this.panelDefs.selectOrderBy,
order: direction,
});
}
return url;
}
@@ -1111,6 +1129,8 @@ class LinkFieldView extends BaseFieldView {
filterList: this.getSelectFilterList(),
createAttributesProvider: createAttributesProvider,
layoutName: this.panelDefs.selectLayout,
orderBy: this.panelDefs.selectOrderBy,
orderDirection: this.panelDefs.selectOrderDirection,
}, view => {
view.render();
+8 -5
View File
@@ -126,12 +126,15 @@ class SelectRecordsModalView extends ModalView {
this.scope = this.entityType = this.options.scope || this.scope;
const customDefaultOrderBy = this.getMetadata().get(['clientDefs', this.scope, 'selectRecords', 'orderBy']);
const customDefaultOrder = this.getMetadata().get(['clientDefs', this.scope, 'selectRecords', 'order']);
const orderBy = this.options.orderBy ||
this.getMetadata().get(['clientDefs', this.scope, 'selectRecords', 'orderBy']);
if (customDefaultOrderBy) {
this.defaultOrderBy = customDefaultOrderBy;
this.defaultOrder = customDefaultOrder || false;
const order = this.options.orderDirection ||
this.getMetadata().get(['clientDefs', this.scope, 'selectRecords', 'order']);
if (orderBy) {
this.defaultOrderBy = orderBy;
this.defaultOrder = order || false;
}
if (this.noCreateScopeList.indexOf(this.scope) !== -1) {