From 8bf13b1f79fd93a1fac6f3b23e709264d53a51e2 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 12 Jan 2022 16:06:33 -0500 Subject: [PATCH] SearchKit - Auto-refresh search when popup forms submit This expands the listener to the entire surrounding
element, in case there are related popups on the Afform. --- .../crmSearchDisplay/traits/searchDisplayBaseTrait.service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js b/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js index 129711f5c3..11d0ab5050 100644 --- a/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js +++ b/ext/search_kit/ang/crmSearchDisplay/traits/searchDisplayBaseTrait.service.js @@ -39,7 +39,8 @@ }); } - $element.on('crmPopupFormSuccess', this.getResults); + // Popup forms in this display or surrounding Afform trigger a refresh + $element.closest('form').on('crmPopupFormSuccess', this.getResults); function onChangeFilters() { ctrl.page = 1; -- 2.25.1