This commit is contained in:
Yurii
2026-01-05 10:26:42 +02:00
parent b26c0368d9
commit 25fbf66a70
+41 -41
View File
@@ -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);