File

projects/i-components/src/lib/pipes/replaceColumnField.pipe.ts

Description

Pipe to access and replace ColumnField string

Metadata

Name replaceColumnField
Pure true

Methods

transform
transform(cell: IgxGridCell)

Transform cell into a valid string.

Parameters :
Name Type Optional
cell IgxGridCell No
Returns : string

{string}

import { Pipe, PipeTransform } from '@angular/core';
import { IgxGridCell } from 'igniteui-angular';

/**
 * Pipe to access and replace ColumnField string
 */
@Pipe({
  name: 'replaceColumnField',
  pure: true,
})
export class ReplaceColumnField implements PipeTransform {
  /**
   * Transform cell into a valid string.
   *
   * @param {IgxGridCell} cell
   * @return {*}  {string}
   * @memberof ReplaceColumnField
   */
  transform(cell: IgxGridCell): string {
    return cell.row.data.data[cell.column.field.replace('data.', '')];
  }
}

result-matching ""

    No results matching ""