Override Table row selection

Hello, I added checkboxes to every row of a table (using the column generation method).

I would like the checkbox to be checked when either the row or the checkbox itself is clicked. Additionally, I need to maintain the multi-selection functionality (using Ctrl or Shift).

Therefore, I need to override the table’s selection method. I would like to implement some logic before the row is selected (such as before the CSS style is applied to the row).