Row click doesn't provide row data if multi-row selection is enabled

Using click event handle, I am able to get clicked row data in the table. table.selectedRow provides the selected row of the table. But if multi-row selection is enabled, table.selectedRow doesn't provide the row data by clicking the row. Instead, checkbox appears and it's only possible to check the rows and get array of rows. But I want to get row data by mouse clicking on the specific row.
I want to know the solution.

You could set Cell selection on the table to Single, and then use table.selectedCell.dataIndex to get the index of the row you clicked. This works with, and is independent of any row selection setting.

The downside is having the focus outline on random cells.

Your row data would be table.data[table.selectedCell.dataIndex], which you can access at the click event.

image

image

1 Like