Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Row Detail redraw all Views when GridMenu/ColPicker columns changes #1277

Merged
merged 1 commit into from
Oct 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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