The sortgrid remembers
3.0.0 (2020-02-27)
Features
- sort: emit previous and current change on sort event (b69abaf)
BREAKING CHANGES
- sort: The sort event now emits a NgsgOrderChange instead of an array
Migration path
The sorted
event now emits a NgsgOrderChange and not an Array. The NgsgOrderChange has the following interface.
export interface NgsgOrderChange<T> { previousOrder: T[]; currentOrder: T[]; }
How to migrate
Before
// Method that is called from template (sorted)="applyOrder($event)"
public applyOrder(newOrder: number[]): void {
this.sortOrder = newOrder;
}
After
// Method that is called from template (sorted)="applyOrder($event)"
public applyOrder(newOrder: NgsgOrderChange<number>): void {
this.sortOrder = newOrder.currentOrder;
}