UNPKG

@progress/kendo-angular-grid

Version:

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

48 lines (47 loc) 2.38 kB
/**----------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the project root for more information *-------------------------------------------------------------------------------------------*/ import { TemplateRef } from '@angular/core'; import * as i0 from "@angular/core"; /** * Uses a predicate to control conditional rendering for the * [`DetailTemplateDirective`]({% slug api_grid_detailtemplatedirective %}). * Allows you to show or hide detail rows based on your logic. ([See example]({% slug detailrowtemplate_grid %}#toc-conditional-display)). * * ``typescript * public myCondition(dataItem: any, index: number) { return dataItem.CategoryID % 2 === 0; } * ``` */ export type DetailTemplateShowIfFn = (dataItem: any, index: number) => boolean; /** * Represents the detail template of the Grid ([more information and examples]({% slug detailrowtemplate_grid %})). * Nest an `<ng-template>` tag with the `kendoGridDetailTemplate` directive inside a `<kendo-grid>` tag to define the detail template. * * @example * ```html * <kendo-grid [data]="data" selectable="true" style="height: 160px"> * <kendo-grid-column field="ProductName"></kendo-grid-column> * <ng-template kendoGridDetailTemplate let-dataItem> * <div *ngIf="dataItem.Category"> * <header>{{dataItem.Category?.CategoryName}}</header> * span>{{dataItem.Category?.Description}}</span> * </div> * </ng-template> * </kendo-grid> * ``` * */ export declare class DetailTemplateDirective { templateRef: TemplateRef<any>; /** * Sets a function to decide if the detail row and the **Expand** or **Collapse** button display for a data item. * The function receives the data item and its index. */ set showIf(fn: DetailTemplateShowIfFn); get showIf(): DetailTemplateShowIfFn; constructor(templateRef: TemplateRef<any>); private _condition; static ɵfac: i0.ɵɵFactoryDeclaration<DetailTemplateDirective, [{ optional: true; }]>; static ɵdir: i0.ɵɵDirectiveDeclaration<DetailTemplateDirective, "[kendoGridDetailTemplate]", never, { "showIf": { "alias": "kendoGridDetailTemplateShowIf"; "required": false; }; }, {}, never, never, true, never>; }