projects/i-components/src/lib/directives/columnEditable.directive.ts
Selector | [wmColumnEditableValue] |
Properties |
Methods |
Inputs |
cellCtx | |
Type : IgxGridCell
|
|
IgxGridCellContext |
columnField | |
Type : string
|
|
Column field property that has changed |
ngOnChanges | ||||||
ngOnChanges(changes: any)
|
||||||
Parameters :
Returns :
void
|
cellCtx |
Type : IgxGridCell
|
Decorators :
@Input()
|
IgxGridCellContext |
columnField |
Type : string
|
Decorators :
@Input()
|
Column field property that has changed |
import { Directive, Input, OnChanges } from '@angular/core';
import { IgxGridCell } from 'igniteui-angular';
/**
*
*
* @export
* @class ColumnEditableValueDirective
* @implements {OnChanges}
*/
@Directive({
selector: '[wmColumnEditableValue]',
})
export class ColumnEditableValueDirective implements OnChanges {
/**
* Column field property that has changed
*
* @memberof ColumnEditableValueDirective
*/
@Input() columnField: string;
/**
* IgxGridCellContext
*
* @memberof ColumnEditableValueDirective
*/
@Input() cellCtx: IgxGridCell;
ngOnChanges(changes: any): void {
if (
changes.columnField &&
changes.columnField.previousValue !== undefined &&
changes.columnField.currentValue !== changes.columnField.previousValue
) {
this.cellCtx.editValue = changes.columnField.currentValue;
}
}
}