我想在AgGrid中获取行的索引。我该怎么办?
{
headerName: 'row',
align: 'center' as const,
dataIndex: 'id',
key: 'id',
width: 20,
valueGetter: column => column.rowIndex + 1,
},
答案 0 :(得分:0)
根据Ag-grid文档:
您可以尝试以下操作:
{
headerName: 'row',
align: 'center' as const,
dataIndex: 'id',
key: 'id',
width: 20,
valueGetter: params => params.node.rowIndex + 1,
},