Skip to content

Commit

Permalink
chore: rollback callback bind change
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding authored Oct 17, 2024
1 parent 1063c5c commit d7e726e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -195,19 +195,19 @@ export class SlickRowDetailView extends UniversalSlickRowDetailView {
// hook some events needed by the Plugin itself

// redraw anytime the grid is re-rendered
this.eventHandler.subscribe(this._grid.onRendered, () => this.redrawAllViewSlots());
this.eventHandler.subscribe(this._grid.onRendered, this.redrawAllViewSlots.bind(this));

// on row selection changed, we also need to redraw
if (this.gridOptions.enableRowSelection || this.gridOptions.enableCheckboxSelector) {
this._eventHandler.subscribe(this._grid.onSelectedRowsChanged, () => this.redrawAllViewSlots());
this._eventHandler.subscribe(this._grid.onSelectedRowsChanged, this.redrawAllViewSlots.bind(this));
}

// 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());
this._eventHandler.subscribe(this._grid.onSort, this.disposeAllViewSlot.bind(this));

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

0 comments on commit d7e726e

Please sign in to comment.