Browse Source

bug fixing edit,delete role project

pull/2/head
nurkomalasari 2 years ago
parent
commit
01e2b480be
  1. 43
      src/views/Master/RoleProject/index.js

43
src/views/Master/RoleProject/index.js

@ -21,25 +21,7 @@ const config = {
}
};
const columns = [
{
title: 'Action',
dataIndex: '',
key: 'x',
className:'nowrap',
render: (text, record) => <>
<Tooltip title="Hapus">
<i className="cil-trash fa-lg" style={{ color: 'red', marginRight: 10, cursor: "pointer" }} onClick={() => this.handleDelete(text.id)}></i>
</Tooltip>
<Tooltip title="Edit">
<i className="fa fa-edit fa-lg" style={{ color: 'green', cursor: "pointer" }} onClick={() => this.handleEdit(text)}></i>
</Tooltip>
</>,
},
{ title: 'Nama Role', dataIndex: 'name', key: 'name', className:"nowrap" },
{ title: 'Description', dataIndex: 'description', key: 'description' },
];
const momentFormat = 'HH:mm';
@ -79,8 +61,30 @@ export default class index extends Component {
totalPage: 0,
typeDialog: 'Save',
}
this.columns = [
{
title: 'Action',
dataIndex: '',
key: 'x',
className: 'nowrap',
render: (text, record) => <>
<Tooltip title="Hapus">
<i className="cil-trash fa-lg" style={{ color: 'red', marginRight: 10, cursor: "pointer" }} onClick={() => this.handleDelete(text.id)}></i>
</Tooltip>
<Tooltip title="Edit">
<i className="fa fa-edit fa-lg" style={{ color: 'green', cursor: "pointer" }} onClick={() => this.handleEdit(text)}></i>
</Tooltip>
</>,
},
{ title: 'Nama Role', dataIndex: 'name', key: 'name', className: "nowrap" },
{ title: 'Description', dataIndex: 'description', key: 'description' },
];
}
async componentDidMount() {
this.getDataRoles();
}
@ -217,6 +221,7 @@ export default class index extends Component {
}
handleDelete = (id) => {
id == '1' ? this.setState({ alertNotDelete: true }) :
this.setState({ alertDelete: true, idDelete: id });
}
@ -356,7 +361,7 @@ export default class index extends Component {
<Table
rowKey="id"
size="small"
columns={columns}
columns={this.columns}
dataSource={dataTable}
pagination={false}
bordered={false}

Loading…
Cancel
Save