From f8d5dd7fa6fa7e22cc8ff255023af0d61e9d780b Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 26 Oct 2023 12:06:49 +0300 Subject: [PATCH] modal select related sync mass remove --- client/src/views/modals/related-list.js | 8 +++++++- client/src/views/record/list.js | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/client/src/views/modals/related-list.js b/client/src/views/modals/related-list.js index 2854f462ca..0c343a334e 100644 --- a/client/src/views/modals/related-list.js +++ b/client/src/views/modals/related-list.js @@ -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(); diff --git a/client/src/views/record/list.js b/client/src/views/record/list.js index 9580417dc8..70c74fade0 100644 --- a/client/src/views/record/list.js +++ b/client/src/views/record/list.js @@ -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));