UNPKG

@progress/kendo-angular-grid

Version:

Kendo UI Grid for Angular - high performance data grid with paging, filtering, virtualization, CRUD, and more.

945 lines (944 loc) 42.9 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { SelectionDirective } from './selection/selection.directive'; import { CellSelectedFn, GridSelectionItem, SelectableSettings, SelectionEvent } from './selection/types'; import { AfterContentInit, AfterViewInit, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, Renderer2, QueryList, SimpleChange, NgZone, ChangeDetectorRef, TemplateRef, TrackByFunction, ViewContainerRef } from '@angular/core'; import { FormGroup } from '@angular/forms'; import { SortDescriptor, GroupDescriptor, CompositeFilterDescriptor } from '@progress/kendo-data-query'; import { DetailTemplateDirective } from './rendering/details/detail-template.directive'; import { ScrollMode } from './scrolling/scrollmode'; import { SortSettings } from './columns/sort-settings'; import { PagerSettings } from './common/pager-settings'; import { BrowserSupportService } from './layout/browser-support.service'; import { GridDataResult, DataCollection } from './data/data.collection'; import { SelectionService } from './selection/selection.service'; import { EditService } from './editing/edit.service'; import { PageChangeEvent, DataStateChangeEvent } from './data/change-event-args.interface'; import { DetailsService } from './rendering/details/details.service'; import { DetailExpandEvent } from './rendering/details/detail-expand-event'; import { DetailCollapseEvent } from './rendering/details/detail-collapse-event'; import { GroupsService } from './grouping/groups.service'; import { ColumnsContainer } from './columns/columns-container'; import { GroupInfoService } from './grouping/group-info.service'; import { GroupableSettings } from './grouping/group-settings'; import { ChangeNotificationService } from './data/change-notification.service'; import { NoRecordsTemplateDirective } from './rendering/no-records-template.directive'; import { ColumnBase } from './columns/column-base'; import { LocalizationService } from '@progress/kendo-angular-l10n'; import { FilterService } from './filtering/filter.service'; import { PDFService } from './pdf/pdf.service'; import { PDFExportEvent } from './pdf/pdf-export-event'; import { ResponsiveService } from "./layout/responsive.service"; import { ExcelService } from './excel/excel.service'; import { ExcelExportEvent } from './excel/excel-export-event'; import { ColumnList } from './columns/column-list'; import { RowClassFn, RowSelectedFn, RowStickyFn, RowSelectableFn } from './rendering/common/row-class'; import { ToolbarTemplateDirective } from "./rendering/toolbar/toolbar-template.directive"; import { EditEvent } from "./editing/edit-event-args.interface"; import { RemoveEvent } from "./editing/remove-event-args.interface"; import { SaveEvent } from "./editing/save-event-args.interface"; import { CancelEvent } from "./editing/cancel-event-args.interface"; import { AddEvent } from "./editing/add-event-args.interface"; import { CellCloseEvent } from './editing/cell-close-event'; import { EditRowOptions } from './editing/edit-row-options.interface'; import { CellClickEvent } from './common/cell-click-event-args.interface'; import { ScrollSyncService } from "./scrolling/scroll-sync.service"; import { DomEventsService } from './common/dom-events.service'; import { ColumnResizingService } from "./column-resizing/column-resizing.service"; import { ColumnResizeArgs, ResizeMode } from './column-resizing/column-resize.interface'; import { FilterableSettings } from './filtering/filterable'; import { ColumnReorderService } from './dragdrop/column-reorder.service'; import { ColumnReorderEvent } from './dragdrop/column-reorder-event'; import { ColumnReorderConfig } from './dragdrop/column-reorder-config'; import { NavigationService } from './navigation/navigation.service'; import { NavigationCell } from './navigation/navigation-cell.interface'; import { NavigationRow } from './navigation/navigation-row.interface'; import { ColumnInfoService } from "./common/column-info.service"; import { ScrollRequestService, ScrollRequest, ScrollToItemRequest } from './scrolling/scroll-request.service'; import { SortService } from './common/sort.service'; import { ColumnMenuTemplateDirective } from './column-menu/column-menu-template.directive'; import { ColumnMenuSettings } from './column-menu/column-menu-settings.interface'; import { ColumnVisibilityChangeEvent } from './column-menu/column-visibility-change-event'; import { ColumnLockedChangeEvent } from './column-menu/column-locked-change-event'; import { ScrollBottomEvent } from './scrolling/scroll-bottom-event'; import { ContentScrollEvent } from './scrolling/content-scroll-event'; import { GridItem } from './data/grid-item.interface'; import { RowArgs } from './rendering/common/row-args'; import { CellSelectionService } from './selection/cell-selection.service'; import { ColumnStickyChangeEvent } from './column-menu/column-sticky-change-event'; import { GroupRowArgs } from './grouping/group-rows-args.interface'; import { CellLoadingTemplateDirective } from './rendering/cell-loading.template.directive'; import { ContextService } from './common/provider.service'; import { LoadingTemplateDirective } from './rendering/loading-template.directive'; import { GridNavigableSettings } from './navigation/navigable-settings'; import { GridSize } from './common/size-options'; import { SizingOptionsService } from './layout/sizing-options.service'; import { RowReorderEvent } from './row-reordering/types'; import { DragTargetContainerDirective, DragTargetDataFn, DropTargetContainerDirective } from '@progress/kendo-angular-utils'; import { RowReorderService } from './row-reordering/row-reorder.service'; import { StatusBarTemplateDirective } from './aggregates/status-bar-template.directive'; import { PagerTemplateDirective } from '@progress/kendo-angular-pager'; import { GridResizableSettings } from './common/resizable-settings'; import * as i0 from "@angular/core"; /** * Represents the Kendo UI for Angular Data Grid component. * * @example * ```html * <kendo-grid [data]="gridData"></kendo-grid> * ``` */ export declare class GridComponent implements AfterContentInit, AfterViewInit, OnDestroy, OnChanges, OnInit { private supportService; selectionService: SelectionService; cellSelectionService: CellSelectionService; wrapper: ElementRef; private groupInfoService; groupsService: GroupsService; private changeNotification; private detailsService; private editService; private filterService; private pdfService; private responsiveService; private renderer; private excelService; private ngZone; private scrollSyncService; private domEvents; private columnResizingService; private changeDetectorRef; private columnReorderService; private columnInfoService; private navigationService; private sortService; private scrollRequestService; private localization; private ctx; private sizingService; rowReorderService: RowReorderService; /** * Sets the data of the Grid. If an array is provided, the Grid automatically gets the total count * ([more information and example]({% slug binding_grid %})). */ set data(value: Array<any> | GridDataResult | null); get data(): Array<any> | GridDataResult | null; get hintText(): string; /** * @hidden */ get customHintTemplate(): TemplateRef<any>; /** * @hidden */ get hintContext(): any; /** * Defines the page size used by the Grid pager. * Required by the [paging]({% slug paging_grid %}) functionality. */ pageSize: number | null | undefined; /** * Defines the height (in pixels) that is used when the `scrollable` option of the Grid is set. * To set the height of the Grid, you can also use `style.height`. The `style.height` * option supports units such as `px`, `%`, `em`, `rem`, and others. */ height: number; /** * Represent the actual height of each Grid row (`tr`) element in the DOM. * Required by the [virtual scrolling functionality]({% slug scrollmmodes_grid %}). * Set the `rowHeight` option to the exact pixels as the height of the `tr` element appears in the DOM. */ rowHeight: number; /** * Represent the actual height of each Grid detail row (`tr`) element in the DOM. * Required by the [virtual scrolling functionality]({% slug scrollmmodes_grid %}). * Set the `detailRowHeight` option to the exact pixels as the height of the detail Grid `tr` element appears in the DOM. */ detailRowHeight: number; /** * Defines the number of records to be skipped by the pager. * Required by the [paging]({% slug paging_grid %}) functionality. */ get skip(): number | null | undefined; set skip(value: number | null | undefined); /** * Defines the scroll mode used by the Grid. * * @default 'scrollable' */ scrollable: ScrollMode; /** * Enables the [single-row selection](slug:grid_row_selection) of the Grid. * * @default false */ selectable: SelectableSettings | boolean; /** * The descriptors by which the data will be sorted ([see example]({% slug sorting_grid %})). */ set sort(value: Array<SortDescriptor> | null | undefined); get sort(): Array<SortDescriptor> | null | undefined; /** * Specifies the sizing of various Grid building blocks (e.g. tables, buttons, inputs, dropdowns, etc.) * @default 'medium' */ set size(size: GridSize); get size(): GridSize; /** * A function that defines how to track changes for the data rows. * By default, the Grid tracks changes by the index of the data item. * Edited rows are tracked by reference. * [See example](slug:track_changes_grid) */ trackBy: TrackByFunction<GridItem>; /** * The descriptor by which the data will be filtered ([see examples]({% slug filtering_grid %})). */ filter: CompositeFilterDescriptor | null | undefined; /** * The descriptors by which the data will be grouped ([see example]({% slug grouping_grid %})). */ set group(value: Array<GroupDescriptor> | null | undefined); get group(): Array<GroupDescriptor> | null | undefined; /** * If set to `true`, the grid will render only the columns in the current viewport. * @default false */ virtualColumns: boolean; /** * @hidden */ get showStatusBar(): boolean; /** * @hidden */ get showTopToolbar(): boolean; /** * @hidden */ get showBottomToolbar(): boolean; /** * @hidden */ get isLocked(): boolean; /** * @hidden */ get showTopPager(): boolean; /** * @hidden */ get showBottomPager(): boolean; /** * @hidden */ get hasPager(): boolean; /** * @hidden */ get showGroupPanel(): boolean; /** * @hidden */ get groupableEmptyText(): string; /** * @hidden */ get marqueeSelection(): boolean; /** * @hidden */ gridData: DragTargetDataFn; /** * Enables the [filtering]({% slug filtering_grid %}) of the Grid columns that have their `field` option set. * @default false */ filterable: FilterableSettings; /** * Enables the [sorting]({% slug sorting_grid %}) of the Grid columns that have their `field` option set. * @default false */ sortable: SortSettings; /** * Configures the pager of the Grid ([see example](slug:paging_grid_settings)). * @default false */ pageable: PagerSettings | boolean; get normalizedPageableSettings(): any; /** * If set to `true`, the user can group the Grid by dragging the column header cells ([see example]({% slug grouping_grid %})). * @default false */ groupable: GroupableSettings | boolean; /** * Determines whether the Grid can be resized. * @default false */ gridResizable: GridResizableSettings | boolean; /** * Enables the [row reordering]({% slug reordering_rows_grid %}) of the Grid. * @default false */ set rowReorderable(value: boolean); get rowReorderable(): boolean; /** * If set to `true`, the user can use dedicated shortcuts to interact with the Grid. * By default, navigation is disabled and the Grid content is accessible in the normal tab sequence. * To enable navigation through separate Grid sections only, provide a [`GridNavigableSection`]({% slug api_grid_gridnavigablesection %}) array. */ set navigable(value: GridNavigableSettings); get navigable(): GridNavigableSettings; /** * @hidden * * An alias for `navigable` for users who migrate from Kendo UI for jQuery. */ set navigatable(value: GridNavigableSettings); /** * @hidden */ get navigatable(): GridNavigableSettings; /** * Indicates whether the Grid columns will be resized during initialization so that * they fit their headers and row content. * Columns with `autoSize` set to `false` are excluded. * To dynamically update the column width to match the new content, * refer to [this example]({% slug resizing_columns_grid %}). * @default false */ autoSize: boolean; /** * Defines a function that is executed for every data row in the component * ([see example](slug:styling_grid_rows)). */ set rowClass(fn: RowClassFn); get rowClass(): RowClassFn; /** * Defines a function that is executed for every data row in the component, * and determines whether the row will be sticky, i.e. always visible after scrolling. */ set rowSticky(fn: RowStickyFn); get rowSticky(): RowStickyFn; /** * Defines a Boolean function that is executed for each data row in the component * ([see example]({% slug grid_selection_custom %}#toc-setting-the-selected-rows)). * Determines whether the row will be selected. */ set rowSelected(fn: RowSelectedFn); get rowSelected(): RowSelectedFn; /** * Defines a Boolean function that is executed for each data row in the component. * Determines whether the row will be selectable. */ set isRowSelectable(fn: RowSelectableFn); get isRowSelectable(): RowSelectableFn; /** * Defines a function that determines the selected state of a data cell. * Returns an object with `selected` and `item` properties. * The cell is marked as selected only if the `selected` property equals `true`. * * The function is executed for each data cell and may be called more than once * as part of a change detection cycle. ([see example]({% slug grid_selection_custom %}#toc-setting-the-selected-cells)) */ set cellSelected(fn: CellSelectedFn); get cellSelected(): CellSelectedFn; /** * Returns the currently focused cell (if any). */ get activeCell(): NavigationCell; /** * Returns the currently focused row (if any). */ get activeRow(): NavigationRow; /** * Returns the current Grid selection. * * @hidden */ get selection(): GridSelectionItem[]; /** * If set to `true`, the user can resize columns by dragging the edges (resize handles) of their header cells * ([see example]({% slug resizing_columns_grid %})). * * @default false */ resizable: boolean | ResizeMode; /** * If set to `true`, the user can reorder columns by dragging their header cells * ([see example]({% slug reordering_columns_grid %})). * * @default false */ reorderable: boolean; /** * Specifies if the loading indicator of the Grid will be displayed ([see example]({% slug binding_grid %})). * * @default false */ set loading(value: boolean); get loading(): boolean; /** * Specifies if the column menu of the columns will be displayed ([see example]({% slug columnmenu_grid %})). * * @default false */ columnMenu: boolean | ColumnMenuSettings; /** * Specifies if the header of the grid will be hidden. The header is visible by default. * The header includes column headers and the [filter row](slug:filter_row). * @default false */ hideHeader: boolean; /** * Fires when the Grid filter is modified through the UI. * You have to handle the event yourself and filter the data. */ filterChange: EventEmitter<CompositeFilterDescriptor>; /** * Fires when the page of the Grid is changed ([see example]({% slug paging_grid %})). * You have to handle the event yourself and page the data. */ pageChange: EventEmitter<PageChangeEvent>; /** * Fires when the grouping of the Grid is changed. * You have to handle the event yourself and group the data ([see example]({% slug grouping_grid %})). */ groupChange: EventEmitter<Array<GroupDescriptor>>; /** * Fires when the sorting of the Grid is changed ([see example]({% slug sorting_grid %})). * You have to handle the event yourself and sort the data. */ sortChange: EventEmitter<Array<SortDescriptor>>; /** * Fires when the user selects a Grid row. */ selectionChange: EventEmitter<SelectionEvent>; /** * Fires when the user drops the dragged row and reordering is performed. */ rowReorder: EventEmitter<RowReorderEvent>; /** * Fires when the data state of the Grid is changed. */ dataStateChange: EventEmitter<DataStateChangeEvent>; /** * Fires when the user expands a group header. */ groupExpand: EventEmitter<GroupRowArgs>; /** * Fires when the user collapses a group header. */ groupCollapse: EventEmitter<GroupRowArgs>; /** * Fires when the user expands a master row. */ detailExpand: EventEmitter<DetailExpandEvent>; /** * Fires when the user collapses a master row. */ detailCollapse: EventEmitter<DetailCollapseEvent>; /** * Fires when the user clicks the **Edit** command button to edit a row * ([see example](slug:inline_editing_grid#editing-records-1)). */ edit: EventEmitter<EditEvent>; /** * Fires when the user clicks the **Cancel** command button to close a row * ([see example]({% slug inline_editing_grid %}#toc-canceling-editing-1)). */ cancel: EventEmitter<CancelEvent>; /** * Fires when the user clicks the **Save** command button to save changes in a row * ([see example]({% slug inline_editing_grid %}#toc-saving-records-1)). */ save: EventEmitter<SaveEvent>; /** * Fires when the user clicks the **Remove** command button to remove a row * ([see example]({% slug inline_editing_grid %}#toc-removing-records-1)). */ remove: EventEmitter<RemoveEvent>; /** * Fires when the user clicks the **Add** command button to add a new row * ([see example]({% slug inline_editing_grid %}#toc-adding-records-1)). */ add: EventEmitter<AddEvent>; /** * Fires when the user leaves an edited cell ([see example](slug:editing_incell_grid)). */ cellClose: EventEmitter<CellCloseEvent>; /** * Fires when the user clicks a cell ([see example](slug:editing_incell_grid)). */ cellClick: EventEmitter<CellClickEvent>; /** * Fires when the user clicks the **Export to PDF** command button. */ pdfExport: EventEmitter<PDFExportEvent>; /** * Fires when the user clicks the **Export to Excel** command button. */ excelExport: EventEmitter<ExcelExportEvent>; /** * Fires when the user completes the resizing of the column. */ columnResize: EventEmitter<Array<ColumnResizeArgs>>; /** * Fires when the user completes the reordering of the column. */ columnReorder: EventEmitter<ColumnReorderEvent>; /** * Fires when the user changes the visibility of the columns from the column menu or column chooser. */ columnVisibilityChange: EventEmitter<ColumnVisibilityChangeEvent>; /** * Fires when the user changes the locked state of the columns from the column menu or by reordering the columns. */ columnLockedChange: EventEmitter<ColumnLockedChangeEvent>; /** * Fires when the user changes the sticky state of the columns from the column menu. */ columnStickyChange: EventEmitter<ColumnStickyChangeEvent>; /** * Fires when the user scrolls to the last record on the page and enables endless scrolling * ([see example]({% slug scrollmmodes_grid %}#toc-endless-scrolling)). * You have to handle the event yourself and page the data. */ scrollBottom: EventEmitter<ScrollBottomEvent>; /** * Fires when the grid content is scrolled. * For performance reasons, the event is triggered outside the Angular zone. Enter the Angular zone if you make any changes that require change detection. */ contentScroll: EventEmitter<ContentScrollEvent>; /** * A query list of all declared columns. */ columns: QueryList<ColumnBase>; get dir(): string; hostClass: boolean; get sizeSmallClass(): boolean; get sizeMediumClass(): boolean; get lockedClasses(): boolean; get virtualClasses(): boolean; get noScrollbarClass(): boolean; get isResizable(): boolean; get minWidth(): string; get maxWidth(): string; get minHeight(): string; get maxHeight(): string; detailTemplateChildren: QueryList<DetailTemplateDirective>; get detailTemplate(): DetailTemplateDirective; set detailTemplate(detailTemplate: DetailTemplateDirective); cellLoadingTemplateChildren: QueryList<CellLoadingTemplateDirective>; get cellLoadingTemplate(): CellLoadingTemplateDirective; set cellLoadingTemplate(cellLoadingTemplate: CellLoadingTemplateDirective); loadingTemplateChildren: QueryList<LoadingTemplateDirective>; get loadingTemplate(): LoadingTemplateDirective; set loadingTemplate(loadingTemplate: CellLoadingTemplateDirective); statusBarTemplateChildren: QueryList<StatusBarTemplateDirective>; get statusBarTemplate(): StatusBarTemplateDirective; set statusBarTemplate(statusBarTemplate: StatusBarTemplateDirective); noRecordsTemplateChildren: QueryList<NoRecordsTemplateDirective>; get noRecordsTemplate(): NoRecordsTemplateDirective; set noRecordsTemplate(customNoRecordsTemplate: NoRecordsTemplateDirective); pagerTemplateChildren: QueryList<PagerTemplateDirective>; get pagerTemplate(): PagerTemplateDirective; set pagerTemplate(customPagerTemplate: PagerTemplateDirective); toolbarTemplateChildren: QueryList<ToolbarTemplateDirective>; get toolbarTemplate(): ToolbarTemplateDirective; set toolbarTemplate(customToolbarTemplate: ToolbarTemplateDirective); columnMenuTemplates: QueryList<ColumnMenuTemplateDirective>; lockedHeader: any; header: any; footer: QueryList<any>; ariaRoot: ElementRef; dragTargetContainer: DragTargetContainerDirective; dropTargetContainer: DropTargetContainerDirective; dialogContainer: ViewContainerRef; get scrollbarWidth(): number; get headerPadding(): any; columnMenuOptions: any; columnList: ColumnList; selectionDirective: boolean | SelectionDirective; ariaRootId: string; showLicenseWatermark: boolean; columnsContainer: ColumnsContainer; view: DataCollection; get hasGroupFooters(): boolean; get showFooter(): boolean; get showGroupFooters(): boolean; get ariaRowCount(): number; get ariaColCount(): number; get navigation(): NavigationService; private shouldGenerateColumns; private direction; private notifyTimeout; private _sort; private _group; private _skip; private _data; private cachedWindowWidth; private defaultSelection; private _rowSelected; private _isRowSelectable; private _cellSelected; private _customDetailTemplate; private _cellLoadingTemplate; private _loadingTemplate; private _statusBarTemplate; private _customNoRecordsTemplate; private _customPagerTemplate; private _customToolbarTemplate; private _rowReorderable; private leafViewportColumns; private viewportColumns; private _navigable; private _size; private _loading; get isVirtual(): boolean; get isScrollable(): boolean; get visibleColumns(): QueryList<ColumnBase>; get lockedColumns(): QueryList<ColumnBase>; get nonLockedColumns(): QueryList<ColumnBase>; get lockedLeafColumns(): QueryList<ColumnBase>; get stickyColumns(): Array<ColumnBase>; get nonLockedLeafColumns(): QueryList<ColumnBase>; get leafColumns(): QueryList<ColumnBase>; get totalColumnLevels(): number; get headerColumns(): any; get headerLeafColumns(): any; get lockedWidth(): number; get nonLockedWidth(): number; get selectableSettings(): SelectableSettings; get columnMenuTemplate(): TemplateRef<any>; get totalCount(): number; /** * @hidden */ getDefaultSelectors(type: string): string; /** * @hidden */ getHintSettings(type: string): any; /** * @hidden */ blockArrowSelection: boolean; private selectionSubscription; private stateChangeSubscription; private groupExpandCollapseSubscription; private editServiceSubscription; private detailsServiceSubscription; private filterSubscription; private sortSubscription; private columnsChangeSubscription; private pdfSubscription; private excelSubscription; private columnsContainerChangeSubscription; private cellClickSubscription; private footerChangeSubscription; private columnResizingSubscription; private columnReorderSubscription; private detachElementEventHandlers; private localizationSubscription; private columnVisibilityChangeSubscription; private columnLockedChangeSubscription; private columnStickyChangeSubscription; private focusElementSubscription; private columnRangeChangeSubscription; private rowReorderSubscription; private rtl; private _rowSticky; constructor(supportService: BrowserSupportService, selectionService: SelectionService, cellSelectionService: CellSelectionService, wrapper: ElementRef, groupInfoService: GroupInfoService, groupsService: GroupsService, changeNotification: ChangeNotificationService, detailsService: DetailsService, editService: EditService, filterService: FilterService, pdfService: PDFService, responsiveService: ResponsiveService, renderer: Renderer2, excelService: ExcelService, ngZone: NgZone, scrollSyncService: ScrollSyncService, domEvents: DomEventsService, columnResizingService: ColumnResizingService, changeDetectorRef: ChangeDetectorRef, columnReorderService: ColumnReorderService, columnInfoService: ColumnInfoService, navigationService: NavigationService, sortService: SortService, scrollRequestService: ScrollRequestService, localization: LocalizationService, ctx: ContextService, sizingService: SizingOptionsService, rowReorderService: RowReorderService); /** * Expands the specified master row ([see example]({% slug hierarchy_grid %})). * * This method is provided only for backwards-compatibility with legacy versions. * These versions tracked the expanded state internally using the data row index. * * For new development, use the [kendoGridDetailsExpandBy directive]({% slug api_grid_expanddetailsdirective %}) * or provide an isDetailExpanded callback. See [Controlling the Expanded State]({% slug master_detail_expanded_state_grid %}) * for examples on how to control the expanded state. * * @param index - The data row index of the master row. */ expandRow(index: number): void; /** * Collapses the specified master row ([see example]({% slug hierarchy_grid %})). * * This method is provided only for backwards-compatibility with legacy versions. * These versions tracked the expanded state internally using the data row index. * * For new development, use the [kendoGridDetailsExpandBy directive]({% slug api_grid_expanddetailsdirective %}) * or provide an isDetailExpanded callback. See [Controlling the Expanded State]({% slug master_detail_expanded_state_grid %}) * for examples on how to control the expanded state. * * @param index - The data row index of the master row. */ collapseRow(index: number): void; /** * Expands a group header item for the given index. For example, * `0_1` expands the second inner group of the first master group. * * This method is provided only for backwards-compatibility with legacy versions. * These versions tracked the expanded group state internally using the hierarchical group index. * * When a Grid is pageable, the indexes of the groups are offset by the current Grid [skip]({% slug api_grid_gridcomponent %}#toc-skip). * * @param {string} index - The underscore separated hierarchical index of the group. */ expandGroup(index: string): void; /** * Collapses a group header item for the given index. For example, * `0_1` collapses the second inner group of the first master group. * * This method is provided only for backwards-compatibility with legacy versions. * These versions tracked the expanded group state internally using the hierarchical group index. * * When a Grid is pageable, the indexes of the groups are offset by the current Grid [skip]({% slug api_grid_gridcomponent %}#toc-skip). * * @param {string} index - The underscore separated hierarchical index of the group. */ collapseGroup(index: string): void; /** * @hidden */ resetGroupsState(): void; /** * @hidden */ onDataChange(): void; ngOnChanges(changes: { [propertyName: string]: SimpleChange; }): void; ngAfterContentInit(): void; ngAfterViewInit(): void; ngAfterContentChecked(): void; ngOnInit(): void; ngOnDestroy(): void; /** * @hidden */ attachScrollSync(): void; /** * @hidden */ get ariaLabel(): string; /** * @hidden */ messageFor: (token: string) => string; /** * Switches the specified table row in the edit mode ([see example]({% slug inline_editing_grid %}#toc-editing-records-1)). * * @param rowIndex - The data row index that will be switched in the edit mode. * @param group - The [FormGroup](link:site.data.urls.angular['formgroupapi']) * that describes the edit form. * @param options - Additional options configuring the focus target once the editor opens. */ editRow(rowIndex: number, group?: FormGroup, options?: EditRowOptions): void; /** * Closes the editor for a given row ([see example]({% slug inline_editing_grid %}#toc-canceling-editing-1)). * * @param {number} index - The row index that will be switched out of the edit mode. If no index is provided, it is assumed * that the new item editor will be closed. */ closeRow(index?: number): void; /** * Creates a new row editor ([see example]({% slug inline_editing_grid %}#toc-adding-records-1)). * * @param {FormGroup} group - The [FormGroup](link:site.data.urls.angular['formgroupapi']) that describes * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields. */ addRow(group: any): void; /** * Puts the cell that is specified by the table row and column in edit mode ([see example](slug:editing_incell_grid)). * * @param {number} rowIndex - The data row index that will be switched in the edit mode. * @param {number|string|any} column - The leaf column index, or the field name or the column instance that should be edited. * @param {FormGroup} group - The [FormGroup](link:site.data.urls.angular['formgroupapi']) * that describes the edit form. */ editCell(rowIndex: number, column: number | string | any, group?: any): void; /** * Closes the current cell in edit mode and fires * the [cellClose]({% slug api_grid_gridcomponent %}#toc-cellclose) event. * * @return {boolean} Indicates whether the edited cell was closed. * A `false` value indicates that the * [cellClose]({% slug api_grid_gridcomponent %}#toc-cellclose) event was prevented. */ closeCell(): boolean; /** * Closes the current cell in edit mode. */ cancelCell(): void; /** * Returns a flag which indicates if a row or a cell is currently edited. * * @return {boolean} A flag which indicates if a row or a cell is currently edited. */ isEditing(): boolean; /** * Returns a flag which indicates if a cell is currently edited. * * @return {boolean} A flag which indicates if a cell is currently being edited. */ isEditingCell(): boolean; /** * Initiates the PDF export ([see example]({% slug pdfexport_grid %})). */ saveAsPDF(): void; /** * Exports the Grid element to a Drawing [Group]({% slug api_kendo-drawing_group %}) by using the `kendo-grid-pdf` component options. * ([see example]({% slug pdfexport_grid %}#toc-exporting-multiple-grids-to-the-same-pdf)). * * @return {Promise} A promise that will be resolved with the Drawing `Group`. */ drawPDF(): Promise<any>; /** * Initiates the Excel export ([see example]({% slug excelexport_grid %})). */ saveAsExcel(): void; /** * Applies the minimum possible width for the specified column, * so that the whole text fits without wrapping. This method expects the Grid * to be [resizable](slug:resizing_columns_grid). The method must be executed * after the Grid is already populated with data. * [See example](slug:resizing_columns_grid#toc-auto-fitting-the-content) */ autoFitColumn(column: ColumnBase): void; /** * Adjusts the width of the specified columns to fit the entire content, including headers, without wrapping. * If no columns are specified, `autoFitColumns` is applied to all columns.The method must be executed * after the Grid is already populated with data. * [See example](slug:resizing_columns_grid#toc-auto-fitting-the-content) * */ autoFitColumns(columns?: Array<ColumnBase> | QueryList<ColumnBase>): void; /** * @hidden */ notifyPageChange(source: string, event: any): void; /** * @hidden */ notifyScrollBottom(): void; /** * @hidden */ focusEditElement(containerSelector: string): void; /** * Focuses the last active or the first cell of the Grid. * * @returns {NavigationCell} The focused cell. */ focus(): NavigationCell; /** * Focuses the cell with the specified row and column index. * * The row index is based on the logical structure of the Grid and does not correspond to the data item index. * Header rows are included, starting at index 0. * Group headers and footers are included. * The row indexing is absolute and does not change with paging. * * If the Grid is configured for scrolling, including virtual scrolling, the scroll position will be updated. * If the row is not present on the current page, the method will have no effect. * * @param rowIndex - The logical row index to focus. The top header row has an index 0. * @param colIndex - The column index to focus. * @returns {NavigationCell} The focused cell. * */ focusCell(rowIndex: number, colIndex: number): NavigationCell; /** * Focuses the next cell, optionally wrapping to the next row. * * @param wrap - A Boolean value which indicates if the focus will move to the next row. Defaults to `true`. * @returns {NavigationCell} The focused cell. If the focus is already on the last cell, returns `null`. */ focusNextCell(wrap?: boolean): NavigationCell; /** * Focuses the previous cell. Optionally wraps to the previous row. * * @param wrap - A Boolean value which indicates if the focus will move to the next row. Defaults to `true`. * @returns {NavigationCell} The focused cell. If the focus is already on the first cell, returns `null`. */ focusPrevCell(wrap?: boolean): NavigationCell; /** * Scrolls to the specified row and column ([see example](slug:scrollmmodes_grid#toc-scrolling-to-a-specific-row-and-column)). */ scrollTo(request: ScrollRequest): void; /** * Scrolls to the specified data item and column ([see example](slug:scrollmmodes_grid#toc-scrolling-to-a-specific-item)). */ scrollToItem(request: ScrollToItemRequest): void; /** * Changes the position of the specified column. * The reordering of columns operates only on the level * which is inferred by the source column. * For the `reorderColumn` method to work properly, * the `source` column has to be visible. * * @param {ColumnBase} source - The column whose position will be changed. * @param {number} destIndex - The new position of the column. * @param {ColumnReorderConfig} options - Additional options. * */ reorderColumn(source: ColumnBase, destIndex: number, options?: ColumnReorderConfig): void; /** * A function which determines if a specific row is expanded. */ set isDetailExpanded(callback: (args: RowArgs) => boolean); get isDetailExpanded(): (args: RowArgs) => boolean; /** * A function which determines if a specific group row is expanded. */ set isGroupExpanded(callback: (args: GroupRowArgs) => boolean); get isGroupExpanded(): (args: GroupRowArgs) => boolean; /** * @hidden */ handleReorderEvents(ev: any, evType: string): void; /** * @hidden */ get flatData(): Array<any>; /** * @hidden */ updateNavigationMetadata(): void; private reorder; private updateColumnIndices; private updateIndicesForLevel; private allColumnsForLevel; private initSelectionService; private setEditFocus; private columnInstance; private verifySettings; private autoGenerateColumns; private attachStateChangesEmitter; private attachEditHandlers; private emitCRUDEvent; private attachDomEventHandlers; private attachElementEventHandlers; private matchesMedia; private resizeCheck; private emitPDFExportEvent; private syncHeaderHeight; private columnsContainerChange; private handleColumnResize; private notifyResize; private assertNavigable; private _rowClass; private navigationMetadata; private applyAutoSize; private onColumnRangeChange; private toggleDetailRowLegacy; private toggleGroupRowLegacy; private shouldResetSelection; private notifyReorderContainers; static ɵfac: i0.ɵɵFactoryDeclaration<GridComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<GridComponent, "kendo-grid", ["kendoGrid"], { "data": { "alias": "data"; "required": false; }; "pageSize": { "alias": "pageSize"; "required": false; }; "height": { "alias": "height"; "required": false; }; "rowHeight": { "alias": "rowHeight"; "required": false; }; "detailRowHeight": { "alias": "detailRowHeight"; "required": false; }; "skip": { "alias": "skip"; "required": false; }; "scrollable": { "alias": "scrollable"; "required": false; }; "selectable": { "alias": "selectable"; "required": false; }; "sort": { "alias": "sort"; "required": false; }; "size": { "alias": "size"; "required": false; }; "trackBy": { "alias": "trackBy"; "required": false; }; "filter": { "alias": "filter"; "required": false; }; "group": { "alias": "group"; "required": false; }; "virtualColumns": { "alias": "virtualColumns"; "required": false; }; "filterable": { "alias": "filterable"; "required": false; }; "sortable": { "alias": "sortable"; "required": false; }; "pageable": { "alias": "pageable"; "required": false; }; "groupable": { "alias": "groupable"; "required": false; }; "gridResizable": { "alias": "gridResizable"; "required": false; }; "rowReorderable": { "alias": "rowReorderable"; "required": false; }; "navigable": { "alias": "navigable"; "required": false; }; "navigatable": { "alias": "navigatable"; "required": false; }; "autoSize": { "alias": "autoSize"; "required": false; }; "rowClass": { "alias": "rowClass"; "required": false; }; "rowSticky": { "alias": "rowSticky"; "required": false; }; "rowSelected": { "alias": "rowSelected"; "required": false; }; "isRowSelectable": { "alias": "isRowSelectable"; "required": false; }; "cellSelected": { "alias": "cellSelected"; "required": false; }; "resizable": { "alias": "resizable"; "required": false; }; "reorderable": { "alias": "reorderable"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "columnMenu": { "alias": "columnMenu"; "required": false; }; "hideHeader": { "alias": "hideHeader"; "required": false; }; "isDetailExpanded": { "alias": "isDetailExpanded"; "required": false; }; "isGroupExpanded": { "alias": "isGroupExpanded"; "required": false; }; }, { "filterChange": "filterChange"; "pageChange": "pageChange"; "groupChange": "groupChange"; "sortChange": "sortChange"; "selectionChange": "selectionChange"; "rowReorder": "rowReorder"; "dataStateChange": "dataStateChange"; "groupExpand": "groupExpand"; "groupCollapse": "groupCollapse"; "detailExpand": "detailExpand"; "detailCollapse": "detailCollapse"; "edit": "edit"; "cancel": "cancel"; "save": "save"; "remove": "remove"; "add": "add"; "cellClose": "cellClose"; "cellClick": "cellClick"; "pdfExport": "pdfExport"; "excelExport": "excelExport"; "columnResize": "columnResize"; "columnReorder": "columnReorder"; "columnVisibilityChange": "columnVisibilityChange"; "columnLockedChange": "columnLockedChange"; "columnStickyChange": "columnStickyChange"; "scrollBottom": "scrollBottom"; "contentScroll": "contentScroll"; }, ["columns", "detailTemplateChildren", "cellLoadingTemplateChildren", "loadingTemplateChildren", "statusBarTemplateChildren", "noRecordsTemplateChildren", "pagerTemplateChildren", "toolbarTemplateChildren", "columnMenuTemplates"], ["kendo-toolbar"], true, never>; }