Commit f45b37e1 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'riri' into 'master'

apdet

See merge request !127
parents 90ca8295 814f6c50
...@@ -465,12 +465,11 @@ export default class ReportItems extends Component { ...@@ -465,12 +465,11 @@ export default class ReportItems extends Component {
openPopUp(index, type) { openPopUp(index, type) {
if (type === 'edit') { if (type === 'edit') {
this.setState({ this.setState({
selectIndex: index, rowData: index,
edit: true edit: true
}) })
} else { } else {
this.setState({ this.setState({
data: this.state.listData[index],
add: true add: true
}) })
} }
...@@ -564,6 +563,7 @@ export default class ReportItems extends Component { ...@@ -564,6 +563,7 @@ export default class ReportItems extends Component {
const columns = [{ const columns = [{
name: "Action", name: "Action",
options: { options: {
sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
...@@ -573,7 +573,7 @@ export default class ReportItems extends Component { ...@@ -573,7 +573,7 @@ export default class ReportItems extends Component {
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent' borderColor: 'transparent'
}} }}
onClick={() => this.openPopUp(tableMeta.rowIndex, 'edit')} onClick={() => this.openPopUp(tableMeta.rowData, 'edit')}
> >
<img src={Images.editCopy} /> <img src={Images.editCopy} />
...@@ -875,7 +875,7 @@ export default class ReportItems extends Component { ...@@ -875,7 +875,7 @@ export default class ReportItems extends Component {
{this.state.edit && ( {this.state.edit && (
<EditReportItems <EditReportItems
onClickClose={() => this.setState({ edit: false })} onClickClose={() => this.setState({ edit: false })}
data={this.state.listData[this.state.selectIndex]} data={this.state.rowData}
refresh={this.getData.bind(this)} refresh={this.getData.bind(this)}
updateReportItems={this.updateReportItems.bind(this)} updateReportItems={this.updateReportItems.bind(this)}
/> />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment