UNPKG

@catull/igniteui-angular

Version:

Ignite UI for Angular is a dependency-free Angular toolkit for building modern web apps

201 lines (200 loc) 5.24 kB
import { ChangeDetectorRef, DoCheck, ElementRef, QueryList } from '@angular/core'; import { IgxCheckboxComponent } from '../checkbox/checkbox.component'; import { IgxGridForOfDirective } from '../directives/for-of/for_of.directive'; import { GridBaseAPIService } from './api.service'; import { IgxGridCellComponent } from './cell.component'; import { IgxColumnComponent } from './columns/column.component'; import { IgxGridBaseDirective } from './grid-base.directive'; import { IgxGridSelectionService, IgxGridCRUDService } from './selection/selection.service'; import { GridType } from './common/grid.interface'; export declare class IgxRowDirective<T extends IgxGridBaseDirective & GridType> implements DoCheck { gridAPI: GridBaseAPIService<T>; crudService: IgxGridCRUDService; selectionService: IgxGridSelectionService; element: ElementRef<HTMLElement>; cdr: ChangeDetectorRef; private _rowData; /** * The data passed to the row component. * * ```typescript * // get the row data for the first selected row * let selectedRowData = this.grid.selectedRows[0].rowData; * ``` */ rowData: any; /** * The index of the row. * * ```typescript * // get the index of the second selected row * let selectedRowIndex = this.grid.selectedRows[1].index; * ``` */ index: number; /** * @hidden */ gridID: string; /** * @hidden */ virtDirRow: IgxGridForOfDirective<any>; /** * @hidden */ checkboxElement: IgxCheckboxComponent; /** * The rendered cells in the row component. * * ```typescript * // get the cells of the third selected row * let selectedRowCells = this.grid.selectedRows[2].cells; * ``` */ cells: QueryList<IgxGridCellComponent>; /** * @hidden */ role: string; readonly dataRowIndex: number; /** * @hidden */ readonly styleClasses: string; /** * @hidden */ selected: boolean; /** * @hidden */ readonly columns: IgxColumnComponent[]; /** * @hidden * @internal */ readonly viewIndex: number; /** * @hidden */ readonly pinnedColumns: IgxColumnComponent[]; /** * @hidden */ readonly unpinnedColumns: IgxColumnComponent[]; /** * @hidden */ readonly showRowSelectors: boolean; /** @hidden */ readonly dirty: boolean; readonly isSelected: boolean; /** * @hidden */ readonly rowDraggable: boolean; /** @hidden */ readonly added: boolean; /** @hidden */ readonly deleted: boolean; /** * @hidden */ dragging: boolean; readonly inEditMode: boolean; /** * Get a reference to the grid that contains the selected row. * * ```typescript * handleRowSelection(event) { * // the grid on which the onRowSelectionChange event was triggered * const grid = event.row.grid; * } * ``` * * ```html * <igx-grid * [data]="data" * (onRowSelectionChange)="handleRowSelection($event)"> * </igx-grid> * ``` */ readonly grid: T; /** * Gets the ID of the row. * A row in the grid is identified either by: * - primaryKey data value, * - the whole rowData, if the primaryKey is omitted. * * ```typescript * let rowID = this.grid.selectedRows[2].rowID; * ``` */ readonly rowID: any; /** * The native DOM element representing the row. Could be null in certain environments. * * ```typescript * // get the nativeElement of the second selected row * let selectedRowNativeElement = this.grid.selectedRows[1].nativeElement; * ``` */ readonly nativeElement: HTMLElement; /** * @hidden */ focused: boolean; /** * @hidden * @internal */ defaultCssClass: string; constructor(gridAPI: GridBaseAPIService<T>, crudService: IgxGridCRUDService, selectionService: IgxGridSelectionService, element: ElementRef<HTMLElement>, cdr: ChangeDetectorRef); /** * @hidden * @internal */ onClick(event: MouseEvent): void; /** * @hidden */ onRowSelectorClick(event: any): void; /** * Updates the specified row object and the data source record with the passed value. * This method emits `onEditDone` event. * * ```typescript * // update the second selected row's value * let newValue = "Apple"; * this.grid.selectedRows[1].update(newValue); * ``` */ update(value: any): void; /** * Removes the specified row from the grid's data source. * This method emits `onRowDeleted` event. * * ```typescript * // delete the third selected row from the grid * this.grid.selectedRows[2].delete(); * ``` */ delete(): void; /** * @hidden */ readonly rowCheckboxAriaLabel: string; /** * @hidden */ ngDoCheck(): void; /** * @hidden */ protected resolveClasses(): string; /** * @hidden */ readonly resolveDragIndicatorClasses: string; }