自定义单元 Table 反应虚拟化
Customize cells Table react-virtualized
我正在使用来自“react-virtualized”的 Table。
一切正常。
我使用 rowRenderer 自定义我的行以添加“react-dnd”并让我的行能够被拖动。
我的问题是关于细胞的。是否可以定制它们?喜欢使用一些 React 组件作为单元格内的下拉菜单吗?
一切都存储在 {columns} props 中,但不知道如何使用它。
非常感谢这个很棒的库。
My question is about cells. Is it possible to customize them ?
是的。您可以为任何 Column
指定 cellRenderer
,如图 in the docs.
function ({
cellData: any,
columnData: any,
dataKey: string,
isScrolling: boolean,
rowData: any,
rowIndex: number
}): node
我正在使用来自“react-virtualized”的 Table。 一切正常。
我使用 rowRenderer 自定义我的行以添加“react-dnd”并让我的行能够被拖动。
我的问题是关于细胞的。是否可以定制它们?喜欢使用一些 React 组件作为单元格内的下拉菜单吗?
一切都存储在 {columns} props 中,但不知道如何使用它。
非常感谢这个很棒的库。
My question is about cells. Is it possible to customize them ?
是的。您可以为任何 Column
指定 cellRenderer
,如图 in the docs.
function ({
cellData: any,
columnData: any,
dataKey: string,
isScrolling: boolean,
rowData: any,
rowIndex: number
}): node