bhaveshpatel200 / vue3-datatable-document

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

Can't find the row index #18

Open marufhasan1 opened 3 months ago

marufhasan1 commented 3 months ago

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

bhaveshpatel200 commented 3 months 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 2 months 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"); } };