From: colemanw Date: Mon, 2 Oct 2023 05:37:14 +0000 (-0400) Subject: SearchKit - When refreshing after a task, refresh all displays in a form X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0177c7fb6eec2e6d8bc06711110b8c7b85d93d7e;p=civicrm-core.git SearchKit - When refreshing after a task, refresh all displays in a form --- diff --git a/ext/search_kit/ang/crmSearchTasks/traits/searchDisplayTasksTrait.service.js b/ext/search_kit/ang/crmSearchTasks/traits/searchDisplayTasksTrait.service.js index a1f7277bfa..47e3b51e5a 100644 --- a/ext/search_kit/ang/crmSearchTasks/traits/searchDisplayTasksTrait.service.js +++ b/ext/search_kit/ang/crmSearchTasks/traits/searchDisplayTasksTrait.service.js @@ -7,7 +7,7 @@ // TaskManager object is responsible for fetching task metadata for a SearchDispaly // and handles the running of tasks. - function TaskManager(displayCtrl) { + function TaskManager(displayCtrl, $element) { var mngr = this; var fetchedMetadata; this.tasks = null; @@ -84,8 +84,11 @@ this.refreshAfterTask = function() { displayCtrl.selectedRows = []; displayCtrl.allRowsSelected = false; - displayCtrl.rowCount = undefined; - displayCtrl.runSearch(); + displayCtrl.rowCount = null; + displayCtrl.getResultsPronto(); + // Trigger all other displays in the same form to update. + // This display won't update twice because of the debounce in getResultsPronto() + $element.trigger('crmPopupFormSuccess'); }; } @@ -201,10 +204,10 @@ }, // onInitialize callback - onInitialize: [function() { + onInitialize: [function($scope, $element) { // Instantiate task manager object if (!this.taskManager) { - this.taskManager = new TaskManager(this); + this.taskManager = new TaskManager(this, $element); } }],