@progress/kendo-react-grid
Version:
React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package
49 lines (48 loc) • 1.74 kB
TypeScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2026 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { GridHeaderCellProps } from '../interfaces/GridHeaderCellProps.js';
import * as React from 'react';
/**
* @example
* ```jsx
* const App = () => {
* const [data, setData] = useState([
* { foo: 'A1', bar: 'B1', b1: 1, b2: 2 },
* { foo: 'A2', bar: 'B2', b1: 3, b2: 4 },
* { foo: 'A3', bar: 'B2', b1: 5, b2: 6 }
* ]);
* const [barDetails, setBarDetails] = useState(false);
*
* const CustomHeaderCell = (props: CustomCellProps) => (
* <td
* {...props.tdProps}
* colSpan={1}>
* <span>
* {props.title || props.field + ' '}
* <Button onClick={() => setBarDetails(!barDetails)}>
* {barDetails ? 'collapse' : 'expand'}
* </Button>
* {props.children}
* </span>
* </td>
* );
*
* return (
* <Grid style={{ height: '420px' }} data={data} reorderable={true}>
* <GridColumn field="foo" />
* <GridColumn field="bar" cells={{ headerCell: CustomHeaderCell }}>
* {barDetails && [<GridColumn field="b1" />, <GridColumn field="b2" />]}
* </GridColumn>
* </Grid>
* );
* };
*
* export default App;
* ```
*/
export declare const GridHeaderCell: (props: GridHeaderCellProps) => React.JSX.Element;