I have a requirement to delete the rows using utility icon in lightning datatable. Used onrowaction, but I don't have any clue what to do in JS method. Can anyone suggest a sample code for it? or explain me through a short logic?
.JS
@track deleteList = [];
handleDelete(event) {
console.log('event.detail.row : ' + JSON.stringify(event.detail.row));
this.deleteList = event.detail.row;
}
.HTML
<lightning-datatable key-field="id" data={mergeObjectList} columns={columnsData}
onrowaction={handleDelete}
hide-checkbox-column show-row-number-column>
</lightning-datatable>