0

I have simple datattable where i am displaying couple of columns ,on click of any row in datatable i need to get the value from Name column to JS for further processing

<template>
<lightning-datatable
        data={data}
        columns={columns}
        key-field="id"
        onrowselection={getNameRowData}>
</lightning-datatable>

JS -

getNameRowData(event) {
    const selectedRows = event.detail.selectedRows;
    console.log('selectedRows>>'+selectedRows);
}

but i am not able to see any logs printing in console.Please help i dont want checkbox ,just when i click on any row then that perticular opp Name needs to get in JS

enter image description here

2
  • Please visit this salesforce.stackexchange.com/questions/319299/…
    – Pavlo M
    Commented Oct 20, 2021 at 12:05
  • I guess the above solutions are when we click on checkbox of that row.Is there any way we can click on that row anywhere and we can capture the data in js instead of clicking checkbox?
    – Sandy
    Commented Oct 21, 2021 at 2:36

0