File

projects/i-components/src/lib/directives/columnEditable.directive.ts

Implements

OnChanges

Metadata

Selector [wmColumnEditableValue]

Index

Properties
Methods
Inputs

Inputs

cellCtx
Type : IgxGridCell

IgxGridCellContext

columnField
Type : string

Column field property that has changed

Methods

ngOnChanges
ngOnChanges(changes: any)
Parameters :
Name Type Optional
changes any No
Returns : void

Properties

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;
    }
  }
}

result-matching ""

    No results matching ""