I am displaying the records in the table which are to be inserted, and want to implement the delete functionality so that the user can delete the records before saving it to the database. There is no unique field or record id.
On click of a button, I want to get the selected row number from lightning-datatable. For example, if I select 3rd and 5th row in the lightning-datatable, on click of a button, I should get 3 and 5 row number.
this.template.querySelector('lightning-datatable').getSelectedRows();, but I am getting complete row data.
How can I get selected row number?