【发布时间】:2021-11-20 05:14:23
【问题描述】:
我遇到了一些麻烦。我试图在 React Table 上为每一行显示一个按钮,但它没有显示,它只显示一个空白列。 这是我的专栏
columns = [
{
dataField: "nama_user",
text: "Nama",
sort: true,
style: { overflowWrap: "break-word" },
headerStyle: { backgroundColor: '#2196F3' , color: 'white'}
},
{
dataField: "email",
text: "Email",
sort: true,
headerStyle: { backgroundColor: '#2196F3' , color: 'white'}
},
{
dataField: "",
text: "Action",
formatter: this.GetUserAction,
headerStyle: { backgroundColor: '#2196F3' , color: 'white'},
classes: "p-1"
}
];
这是包含按钮的函数
GetUserAction = (cell, row, rowIndex, formatExtraData) => {
return (
<div>
<button className="update" onClick={this.handleClickOpen}>
Edit
</button>
<button className="update" onClick={this.aktivasiUser(row)}>
Aktivasi
</button>
</div>
);
}
也许我错过了我的代码中的某些内容?感谢您的回答。
【问题讨论】:
标签: reactjs react-table