core/src/utils/row-change-event.ts
This event is emitted by TableEditorRowDirective when a row transition occurs.
Properties |
Public action |
action:
|
Type : NavigationAction | null
|
Defined in core/src/utils/row-change-event.ts:13
|
The navigation action associated that caused the |
Public next |
next:
|
Type : RowChangeContext<T>
|
Default value : { row: null, context: null }
|
Defined in core/src/utils/row-change-event.ts:11
|
A RowChangeContext of the row that is being transitioned from. |
Public previous |
previous:
|
Type : RowChangeContext<T>
|
Default value : { row: null, context: null }
|
Defined in core/src/utils/row-change-event.ts:9
|
A RowChangeContext of the row that is being transitioned from. |
import { TableEditorRowDirective } from '../table/row.directive';
import { NavigationAction } from '../navigators/navigator';
/** This event is emitted by {@link TableEditorRowDirective} when a row transition occurs.
* @param T ContextType The type of the context field.
*/
export class RowChangeEvent<T = any> {
/** A {@link RowChangeContext} of the row that is being transitioned from. */
public previous: RowChangeContext<T> = { row: null, context: null };
/** A {@link RowChangeContext} of the row that is being transitioned from. */
public next: RowChangeContext<T> = { row: null, context: null };
/** The [navigation action]{@link NavigationAction} associated that caused the `RowChangeEvent` */
public action: NavigationAction | null;
/** @internal */
constructor(prevRow: TableEditorRowDirective | null = null, nextRow: TableEditorRowDirective | null = null, action: NavigationAction | null = null) {
if (prevRow != null) {
this.previous.row = prevRow;
this.previous.context = prevRow.context;
}
if (nextRow != null) {
this.next.row = nextRow;
this.next.context = nextRow.context;
}
this.action = action;
}
}
export interface RowChangeContext<T = any> {
row: TableEditorRowDirective | null;
context: T | null;
}