-
Notifications
You must be signed in to change notification settings - Fork 929
Closed
Labels
Description
Hi, I have a question regarding the use of onRowsDelete.
I want to use the following function to remove items from the table, but I don't know if I am using it correctly combined with the option onRowsDelete Thanks in advance.
handleDeleteUser = (idToDelete) => {
axios.delete(https://jsonplaceholder.typicode.com/users/${idToDelete}
)
.then(response => {
console.log(response);
})
.catch(error => {
console.log(error);
});
};
render() {
const options = {
onRowsDelete: (rowsDeleted) => {
const idsToDelete = rowsDeleted.data.map(item => item.dataIndex)
idsToDelete.map(idToDelete => this.handleDeleteUser(idToDelete))
}
};