Class IgxGridCellComponent

Providing reference to IgxGridCellComponent:

@ViewChild('grid', { read: IgxGridComponent })
 public grid: IgxGridComponent;
 let column = this.grid.columnList.first;
 let cell = column.cells[0];

Hierarchy

Implements

  • OnInit
  • OnChanges
  • OnDestroy

Constructors

constructor

Properties

activeHighlightClass

activeHighlightClass: string = "igx-highlight__active"

Sets/gets the active highlight class class of the cell. Default value is "igx-highlight__active".

let activeHighlightClass = this.cell.activeHighlightClass;
this.cell.activeHighlightClass = 'igx-cell-highlight_active';
memberof

IgxGridCellComponent

cdr

cdr: ChangeDetectorRef

cellTemplate

cellTemplate: TemplateRef<any>

Sets/gets the template of the cell.

<ng-template #cellTemplate igxCell let-value>
  <div style="font-style: oblique; color:blueviolet; background:red">
      <span>{{value}}</span>
  </div>
</ng-template>
@ViewChild('cellTemplate',{read: TemplateRef})
cellTemplate: TemplateRef<any>;
this.cell.cellTemplate = this.cellTemplate;
let template =  this.cell.cellTemplate;
memberof

IgxGridCellComponent

column

Gets the column of the cell.

 let cellColumn = this.cell.column;
memberof

IgxGridCellComponent

editMode

editMode: boolean = false

Returns whether the cell is in edit mode.

formatter

formatter: function

Gets the cell formatter.

let cellForamatter = this.cell.formatter;
memberof

IgxGridCellComponent

Type declaration

    • (value: any): any
    • Parameters

      • value: any

      Returns any

gridAPI

gridAPI: GridBaseAPIService<IgxGridBaseComponent & IGridDataBindable>

highlightClass

highlightClass: string = "igx-highlight"

Sets/gets the highlight class of the cell. Default value is "igx-highlight".

let highlightClass = this.cell.highlightClass;
this.cell.highlightClass = 'igx-cell-highlight';
memberof

IgxGridCellComponent

role

role: string = "gridcell"

Sets/get the role property of the cell. Default value is "gridcell".

this.cell.role = 'grid-cell';
let cellRole = this.cell.role;
memberof

IgxGridCellComponent

row

row: any

Gets the row of the cell.

let cellRow = this.cell.row;
memberof

IgxGridCellComponent

rowData

rowData: any

Gets the data of the row of the cell.

let rowData = this.cell.rowData;
memberof

IgxGridCellComponent

selection

selection: IgxSelectionAPIService

tabindex

tabindex: number = 0

Sets/get the tabindex property of the cell. Default value is 0.

this.cell.tabindex = 1;
let cellTabIndex = this.cell.tabindex;
memberof

IgxGridCellComponent

value

value: any

Sets/gets the cell value.

this.cell.value = "Cell Value";
let cellValue = this.cell.value;
memberof

IgxGridCellComponent

width

width: string = ""

Gets the width of the cell.

let cellWidth = this.cell.width;
memberof

IgxGridCellComponent

Accessors

cellID

  • get cellID(): object

colEnd

  • get colEnd(): number

colStart

  • get colStart(): number

columnIndex

  • get columnIndex(): number
  • Gets the index of the cell column.

    let columnIndex = this.cell.columnIndex;
    memberof

    IgxGridCellComponent

    Returns number

context

  • get context(): any
  • Gets the cell template context object.

     let context = this.cell.context();
    memberof

    IgxGridCellComponent

    Returns any

describedby

  • get describedby(): string
  • Returns a string containing the grid id and the column field concatenated by "_".

    let describedBy = this.cell.describedBy;
    memberof

    IgxGridCellComponent

    Returns string

dirty

  • get dirty(): any

editValue

  • get editValue(): any
  • set editValue(value: any): void
  • Gets the current edit value while a cell is in edit mode. Only for cell editing mode.

    let editValue = this.cell.editValue;
    memberof

    IgxGridCellComponent

    Returns any

  • Sets the current edit value while a cell is in edit mode. Only for cell editing mode.

    this.cell.editValue = value;
    memberof

    IgxGridCellComponent

    Parameters

    • value: any

    Returns void

editable

  • get editable(): boolean

grid

  • get grid(): any

gridColumnSpan

  • get gridColumnSpan(): number

gridID

  • get gridID(): any
  • Gets the id of the grid in which the cell is stored.

    let gridId = this.cell.gridID;
    memberof

    IgxGridCellComponent

    Returns any

gridRowSpan

  • get gridRowSpan(): number

inEditMode

  • get inEditMode(): boolean
  • set inEditMode(value: boolean): void
  • deprecated

    Use cell.editMode as a getter and cell.setEditMode(true | false) to start/exit edit mode.

    Gets/sets whether the cell is in edit mode.

    let isCellInEditMode = this.cell.inEditMode;
    memberof

    IgxGridCellComponent

    Returns boolean

  • Parameters

    • value: boolean

    Returns void

nativeElement

  • get nativeElement(): HTMLElement
  • Returns a reference to the nativeElement of the cell.

    let cellNativeElement = this.cell.nativeElement;
    memberof

    IgxGridCellComponent

    Returns HTMLElement

readonly

  • get readonly(): boolean
  • Gets whether the cell is editable.

    let isCellReadonly = this.cell.readonly;
    memberof

    IgxGridCellComponent

    Returns boolean

rowEnd

  • get rowEnd(): number

rowIndex

  • get rowIndex(): number
  • Gets the index of the row where the cell is stored.

    let rowIndex = this.cell.rowIndex;
    memberof

    IgxGridCellComponent

    Returns number

rowStart

  • get rowStart(): number

selected

  • get selected(): boolean
  • set selected(val: boolean): void
  • Gets whether the cell is selected.

    let isSelected = this.cell.selected;
    memberof

    IgxGridCellComponent

    Returns boolean

  • Selects/deselects the cell.

    this.cell.selected = true.
    memberof

    IgxGridCellComponent

    Parameters

    • val: boolean

    Returns void

template

  • get template(): TemplateRef<any>
  • Gets the cell template.

    let template = this.cell.template;
    memberof

    IgxGridCellComponent

    Returns TemplateRef<any>

visibleColumnIndex

  • get visibleColumnIndex(): number
  • set visibleColumnIndex(val: number): void
  • Gets the visible index of the in which the cell is stored.

    let visibleColumnIndex = this.cell.visibleColumnIndex;
    memberof

    IgxGridCellComponent

    Returns number

  • Gets the visible index of the in which the cell is stored.

    let visibleColumnIndex = this.cell.visibleColumnIndex;

    Parameters

    • val: number

    Returns void

Methods

clearHighlight

  • clearHighlight(): void
  • Clears the highlight of the text in the cell.

    this.cell.clearHighLight();
    memberof

    IgxGridCellComponent

    Returns void

highlightText

  • highlightText(text: string, caseSensitive?: boolean, exactMatch?: boolean): number
  • If the provided string matches the text in the cell, the text gets highlighted.

    this.cell.highlightText('Cell Value', true);
    memberof

    IgxGridCellComponent

    Parameters

    • text: string
    • Optional caseSensitive: boolean
    • Optional exactMatch: boolean

    Returns number

isCellSelected

  • isCellSelected(): boolean
  • Gets whether the cell is selected.

    let isCellSelected = thid.cell.isCellSelected();
    memberof

    IgxGridCellComponent

    Returns boolean

setEditMode

  • setEditMode(value: boolean): void

update

  • update(val: any): void
  • Sets new value to the cell.

    this.cell.update('New Value');
    memberof

    IgxGridCellComponent

    Parameters

    • val: any

    Returns void