mmhglobal-dynamicform 2.15.2 → 2.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1808,6 +1808,7 @@ class MainService {
1808
1808
  this.group.signalRCallbackHandler = {};
1809
1809
  }
1810
1810
  this.group.signalRCallbackHandler['alertFormModified'] = this.alertFormModified.bind(this, formId);
1811
+ this.signalrService.unsubscribeFromEvent(`${eventName}`); // unsubscribe the event before subscribe to event again.
1811
1812
  this.signalrService.subscribeToEvent(this.group, `${eventName}`, `group.signalRCallbackHandler.alertFormModified`);
1812
1813
  }
1813
1814
  else {
@@ -2841,8 +2842,31 @@ class ZGridBindingDirective extends DataBindingDirective {
2841
2842
  }
2842
2843
  });
2843
2844
  }
2844
- this.changeEvent.filterChanged = true;
2845
- this.getDataBinding();
2845
+ if (this.field.GridFilterConfiguration?.OnChange) {
2846
+ console.log("GridFilterConfiguration.OnChange triggered");
2847
+ // Use switchMap to handle the asynchronous operation
2848
+ of(this.params.filterParams).pipe(switchMap((filterParams) => {
2849
+ let expression = this.field.GridFilterConfiguration.OnChange;
2850
+ expression = expression.replace('modalGroup.', 'group.');
2851
+ expression = expression.replace('group.', 'grp.');
2852
+ const func = eval('this.' + expression);
2853
+ const callFunc = func.bind(this.grp);
2854
+ return callFunc(filterParams);
2855
+ })).subscribe((updatedFilterParams) => {
2856
+ console.log(updatedFilterParams);
2857
+ // update filterParams
2858
+ if (updatedFilterParams) {
2859
+ this.params.filterParams = updatedFilterParams;
2860
+ }
2861
+ this.changeEvent.filterChanged = true;
2862
+ this.getDataBinding();
2863
+ });
2864
+ }
2865
+ else {
2866
+ // If there is no GridFilterConfiguration.OnChange
2867
+ this.changeEvent.filterChanged = true;
2868
+ this.getDataBinding();
2869
+ }
2846
2870
  }
2847
2871
  dataStateChange(state) {
2848
2872
  this.grid.loading = true;