Skip to content

Commit

Permalink
SearchKit - When refreshing after a task, refresh all displays in a form
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw committed Oct 2, 2023
1 parent 9ac424c commit d5cd780
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
};
}

Expand Down Expand Up @@ -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);
}
}],

Expand Down

0 comments on commit d5cd780

Please sign in to comment.