modal select related sync mass remove

This commit is contained in:
Yuri Kuznetsov
2023-10-26 12:06:49 +03:00
parent 7408f97fbd
commit f8d5dd7fa6
2 changed files with 11 additions and 1 deletions
+7 -1
View File
@@ -281,7 +281,7 @@ class RelatedListModalView extends ModalView {
this.waitForView('search');
}
this.getCollectionFactory().create(this.scope, (collection) => {
this.getCollectionFactory().create(this.scope, collection => {
collection.maxSize = this.getConfig().get('recordsPerPage');
collection.url = this.url;
@@ -297,6 +297,12 @@ class RelatedListModalView extends ModalView {
panelModel.set(model.attributes);
}
});
this.listenTo(collection, 'after:mass-remove', () => {
this.panelCollection.fetch({
skipCollectionSync: true,
});
});
}
this.setupSearch();
+4
View File
@@ -1418,6 +1418,8 @@ class ListRecordView extends View {
Espo.Ui.success(this.translate(msg, 'messages').replace('{count}', count));
});
this.collection.trigger('after:mass-remove');
Espo.Ui.notify(false);
};
@@ -1463,6 +1465,8 @@ class ListRecordView extends View {
}
}
this.collection.trigger('after:mass-remove');
const msg = count === 1 ? 'massRemoveResultSingle' : 'massRemoveResult';
Espo.Ui.success(this.translate(msg, 'messages').replace('{count}', count));