react-bootstrap-table2 icon indicating copy to clipboard operation
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?

Open chsunilkumar33 opened this issue 3 years ago • 0 comments

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 image

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

chsunilkumar33 avatar May 07 '22 10:05 chsunilkumar33