Skip to content

Commit

Permalink
fix: Row Detail redraw all Views when GridMenu/ColPicker columns chan…
Browse files Browse the repository at this point in the history
…ges (#1277)
  • Loading branch information
ghiscoding authored Oct 19, 2024
1 parent 8527bb2 commit 8f549b0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/aurelia-slickgrid/src/extensions/slickRowDetailView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
protected _subscriptions: EventSubscription[] = [];
protected _userProcessFn?: (item: any) => Promise<any>;
protected _viewModel?: Constructable;

constructor(
protected readonly aureliaUtilService: AureliaUtilService = resolve(AureliaUtilService),
private readonly eventPubSubService: EventPubSubService = resolve(EventPubSubService),
Expand All @@ -54,7 +54,7 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
set eventHandler(eventHandler: SlickEventHandler) {
this._eventHandler = eventHandler;
}

get gridOptions(): GridOption {
return (this._grid?.getOptions() || {}) as GridOption;
}
Expand Down Expand Up @@ -205,11 +205,10 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
// on column sort/reorder, all row detail are collapsed so we can dispose of all the Views as well
this._eventHandler.subscribe(this._grid.onSort, this.disposeAllViewSlot.bind(this));

// on filter changed, we need to re-render all Views
// redraw all Views whenever certain events are triggered
this._subscriptions.push(
this.eventPubSubService?.subscribe('onFilterChanged', this.redrawAllViewSlots.bind(this)),
this.eventPubSubService?.subscribe('onGridMenuClearAllFilters', () => window.setTimeout(() => this.redrawAllViewSlots())),
this.eventPubSubService?.subscribe('onGridMenuClearAllSorting', () => window.setTimeout(() => this.redrawAllViewSlots())),
this.eventPubSubService?.subscribe(['onFilterChanged', 'onGridMenuColumnsChanged', 'onColumnPickerColumnsChanged'], this.redrawAllViewSlots.bind(this)),
this.eventPubSubService?.subscribe(['onGridMenuClearAllFilters', 'onGridMenuClearAllSorting'], () => window.setTimeout(() => this.redrawAllViewSlots())),
);
}
}
Expand Down

0 comments on commit 8f549b0

Please sign in to comment.