react-bootstrap-table2
react-bootstrap-table2 copied to clipboard
How to select more than one row but not all rows using id and based on id I want to delete the records, how can I achieve that?
Question How to select more than one row but not all rows using id and based on id I want to delete the records, how can I achieve that? I am not able to pass the Id in Api..
Here Is how I am trying function onRowSelect(row, isSelect, e) { Setleaddata((rows) => { return leaddata.map((sd) => { if (sd._id === rows._id) { sd.select = isSelect; } return sd; }); }); }
const deletemultiplerp = async () => {
let arrayids = [];
await leaddata.forEach((d) => {
if (d.select) {
arrayids.push(d._id);
}
axios .post(${SERVER_URL}/deletecustomers, {
arrayids,
})
.then((resultdeleted) => {
console.log('res', res);
}
});
Screenshots
My UI is like this

codesandbox Please give a simple and minimal example on https://codesandbox.io so that we can reproduce it easily.