【发布时间】:2019-01-10 02:49:59
【问题描述】:
我的 reactJS 网页有这个带有 2 个按钮的反应表,我想在单元格列状态更改其值时更改这些按钮。
render() {
const columns = [
{
Header: "Actions",
accessor: "ID",
Cell: ({ value }) => (
<div style={buttonTablestyle}>
<Button
bsStyle="info"
onClick={() => {
if (window.confirm("You are approving this request after you press OK...")) {
this.updateFunctionYES(value);
}
}}
>
Approve
</Button>
<Button
bsStyle="warning"
onClick={() => {
if (window.confirm("You are rejecting this request after you press OK...")) {
this.updateFunctionNO(value);
}
}}
>
Reject
</Button>
</div>
)
}
];
}
【问题讨论】:
-
这意味着如果有特殊情况你只需要第一个按钮,如果它改变了另一个按钮应该出现但第一个没有?
标签: reactjs react-table