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
  • AfterViewInit

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

focused

focused: boolean = false

gridAPI

gridAPI: GridBaseAPIService<IgxGridBaseComponent>

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

isInCompositionMode

isInCompositionMode: boolean = false

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

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

Accessors

cellID

  • get cellID(): object

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.

    let isLastPinned = this.cell.isLastPinned;
    memberof

    IgxGridCellComponent

    Parameters

    • value: any

    Returns void

formatter

  • get formatter(): function
  • Gets the cell formatter.

    let cellForamatter = this.cell.formatter;
    memberof

    IgxGridCellComponent

    Returns function

      • (value: any): any
      • Parameters

        • value: any

        Returns any

grid

  • get grid(): any

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

inEditMode

  • get inEditMode(): boolean
  • set inEditMode(value: boolean): void
  • Gets whether the cell is in edit mode.

    let isCellInEditMode = this.cell.inEditMode;
    memberof

    IgxGridCellComponent

    Returns boolean

  • Enables/disables the edit mode of the cell

    this.cell.inEditMode = true;
    memberof

    IgxGridCellComponent

    Parameters

    • value: boolean

    Returns void

isLastPinned

  • get isLastPinned(): boolean
  • Gets whether the cell is stored in the last column in the pinned area.

    let isLastPinned = this.cell.isLastPinned;
    memberof

    IgxGridCellComponent

    Returns boolean

isLastUnpinned

  • get isLastUnpinned(): boolean
  • Gets whether the cell is stored in the last column in the unpinned area.

    let isLastUnpinned = this.cell.isLastUnpinned;
    memberof

    IgxGridCellComponent

    Returns boolean

isPinned

  • get isPinned(): boolean
  • Gets whether the cell is stored in a pinned column.

    let isPinned = this.cell.isPinned;
    memberof

    IgxGridCellComponent

    Returns boolean

nativeElement

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

    let cellNativeElement = this.cell.nativeElement;
    memberof

    IgxGridCellComponent

    Returns any

readonly

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

    let isCellReadonly = this.cell.readonly;
    memberof

    IgxGridCellComponent

    Returns boolean

rowIndex

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

    let rowIndex = this.cell.rowIndex;
    memberof

    IgxGridCellComponent

    Returns 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

styleClasses

  • get styleClasses(): string
  • Gets the style classes of the cell.

    let cellStyleClasses = this.cell.styleClasses.
    memberof

    IgxGridCellComponent

    Returns string

template

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

    let template = this.cell.template;
    memberof

    IgxGridCellComponent

    Returns TemplateRef<any>

unpinnedColumnIndex

  • get unpinnedColumnIndex(): number
  • Gets the index of the unpinned column in which the cell is stored.

    let unpinnedColumnIndex = this.cell.ununpinnedColumnIndex;
    memberof

    IgxGridCellComponent

    Returns number

visibleColumnIndex

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

    let visibleColumnIndex = this.cell.visibleColumnIndex;
    memberof

    IgxGridCellComponent

    Returns number

width

  • get width(): string

Methods

_updateCellSelectionStatus

  • _updateCellSelectionStatus(fireFocus?: boolean, event: any): void

clearHighlight

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

    this.cell.clearHighLight();
    memberof

    IgxGridCellComponent

    Returns void

dispatchEvent

  • dispatchEvent(event: KeyboardEvent): 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

onKeydownEnterEditMode

  • onKeydownEnterEditMode(event: any): void

onKeydownExitEditMode

  • onKeydownExitEditMode(event: any): void

update

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

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

    IgxGridCellComponent

    Parameters

    • val: any

    Returns void