Selecting Rows on click of Row

What is happening:

We have a multiSelect table that we would like clicking a row to select it. We have the code to do that (using table.selectRow() to set the selection) but the issue is the default checkbox. Clicking anywhere on the row now toggles it in the selection, including clicking the checkbox, which causes it to toggle twice for no change. The toggle from the checkbox takes effect before the event handler for the row, so there is no way to account for it using that.

My question:

Is there a way to customize the logic behind a table's checkbox that appears when you set the table to multiselect, a way to know if you are clicking in the aformentioned column to not run the row logic I have, or some other solution to this?

Table checkbox I am talking about where clicking toggles selection:
Screenshot 2024-08-28 at 12.58.58 PM

Event Handler:
image
Query10:

let selectedRows = table10.selectedRows.map((item) => item.id);

if (selectedRows.includes(rowId)) {
  selectedRows = selectedRows.filter((item) => item != rowId);
} else {
  selectedRows.push(rowId);
}

table10.selectRow({ key: selectedRows });
1 Like

Hi there @Jay_Walters,

I don't think there is a way to know if you are clicking on the checkbox column.

I remember this thread with a feature request that could solve this (as you would be using another property instead of selected row) and linking it so that your use case it's added there.

An event handler to reflexively fix this would work, but would show the checkbox being checked by the user's click, unchecked by the reflexive event handler in the example you provided, then checked again by the row's event handler. This would not be a good user experience.
What I'm hoping for is the ability to control the behaviour of selecting that checkbox, much like how the "save" button works for the table when there is a changeset array. That way we can have the "click" of the checkbox do nothing as it is already being handled elsewhere.
There may be a better solution than that though, such as being able to exclude that column from the click row behaviour shown in my event handler in the post above.

Hi @Jay_Walters :wave:

Thank you for reaching out about this area of friction in our product. I've surfaced it with our engineering team and will keep you update here with any decisions or progress made.