【发布时间】:2022-01-15 07:25:41
【问题描述】:
我有一个 primereact DataTable,其中有一列包含这样的按钮:
<Column header="Actions" body={
<div>
<Button icon="pi pi-pencil" className="p-button-rounded p-button-text"
onClick={(e) => {
//How do I obtain the row index here?
}
}/>
</div>
}>
</Column>
从评论中可以看出,我需要在用户单击按钮时获取行索引,因为我想对该特定行执行操作。
有可能吗?我该怎么做?
【问题讨论】:
标签: reactjs jsx primereact