bhaveshpatel200 / vue3-datatable-document

vue3-datatable-document.vercel.app
MIT License
21 stars 10 forks source link

Can't find the row index #18

Open marufhasan1 opened 4 weeks ago

marufhasan1 commented 4 weeks ago

Is there any way to get the row index on any of the column's slots?

bhaveshpatel200 commented 4 weeks ago

Hi,

You can get only row data which is passed in rows. you can use id instead of row index if possible. as not sure what's your use case.

sahilbhardwaj1 commented 1 week ago

Hi @bhaveshpatel200 , have a use case when se delete the record after the success, we splice the item according to the index. We don't need to find the index of deleted item.

const deleteCategory = async (data, index) => { const confirmed = await showDeleteConfirmation(); if (confirmed) { const R = await UseCategory.deleteCategory(data._id); if (R.status) { categoryList.value.splice(index, 1); } } else { console.log("Delete canceled"); } };