From 25fbf66a7079b36a08d6fad22bf1b9995202156d Mon Sep 17 00:00:00 2001 From: Yurii Date: Mon, 5 Jan 2026 10:26:42 +0200 Subject: [PATCH] ref --- .../src/views/record/panels/relationship.js | 82 +++++++++---------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/client/src/views/record/panels/relationship.js b/client/src/views/record/panels/relationship.js index 93481efbf7..12b50cc621 100644 --- a/client/src/views/record/panels/relationship.js +++ b/client/src/views/record/panels/relationship.js @@ -363,50 +363,50 @@ class RelationshipPanelView extends BottomPanelView { this.listViewName = viewName; this.rowActionsView = this.defs.readOnly ? false : (this.defs.rowActionsView || this.rowActionsView); - this.once('after:render', () => { - this.createView('list', viewName, { - collection: collection, - layoutName: layoutName, - listLayout: listLayout, - checkboxes: false, - rowActionsView: this.rowActionsView, - buttonsDisabled: true, - selector: '.list-container', - skipBuildRows: true, - rowActionsOptions: { - unlinkDisabled: this.defs.unlinkDisabled, - editDisabled: this.defs.editDisabled, - removeDisabled: this.defs.removeDisabled, - }, - displayTotalCount: false, - additionalRowActionList: this.defs.rowActionList, - }, view => { - view.getSelectAttributeList(selectAttributeList => { - if (selectAttributeList) { - if (this.defs.mandatoryAttributeList) { - selectAttributeList = [...selectAttributeList, ...this.defs.mandatoryAttributeList]; - - selectAttributeList = selectAttributeList - .filter((it, i) => selectAttributeList.indexOf(it) === i); - - } - - collection.data.select = selectAttributeList.join(','); - } - - if (!this.defs.hidden) { - collection.fetch(); - - return; - } - - this.once('show', () => collection.fetch()); + this.once('after:render', async () => { + const view = /** @type {import('views/record/list').default} */ + await this.createView('list', viewName, { + collection: collection, + layoutName: layoutName, + listLayout: listLayout, + checkboxes: false, + rowActionsView: this.rowActionsView, + buttonsDisabled: true, + selector: '.list-container', + skipBuildRows: true, + rowActionsOptions: { + unlinkDisabled: this.defs.unlinkDisabled, + editDisabled: this.defs.editDisabled, + removeDisabled: this.defs.removeDisabled, + }, + displayTotalCount: false, + additionalRowActionList: this.defs.rowActionList, }); - if (this.defs.syncBackWithModel) { - this.listenTo(view, 'after:save after:delete', () => this.processSyncBack()); + let selectAttributeList = await view.getSelectAttributeList(); + + if (selectAttributeList) { + if (this.defs.mandatoryAttributeList) { + selectAttributeList = [...selectAttributeList, ...this.defs.mandatoryAttributeList]; + + selectAttributeList = selectAttributeList + .filter((it, i) => selectAttributeList.indexOf(it) === i); } - }); + + collection.data.select = selectAttributeList.join(','); + } + + if (!this.defs.hidden) { + collection.fetch(); + + return; + } + + this.once('show', () => collection.fetch()); + + if (this.defs.syncBackWithModel) { + this.listenTo(view, 'after:save after:delete', () => this.processSyncBack()); + } }); this.wait(false);