2

I'm using ag-grid: https://www.ag-grid.com

I've tried the following grid options:

rowSelection: 'multiple',
suppressRowClickSelection: true,
rowDeselection: true

This results with rows not being selected when clicked...

And i try to achieve row selection (When you click on a row, the row will be marked) but without making the row's checkbox being checked...

Is there any way to achieve this behavior?

Thanks

user3688064
  • 103
  • 1
  • 9

4 Answers4

0

You have several cheat options that essentially involve smoke and mirrors.

i.e

use a css style override on row focus

.ag-fresh .ag-row-focus { 
  background-color:white;
}

or do not show the row selection checkbox and instead show a checkbox with your own check in that you control yourself

Matrim
  • 645
  • 7
  • 13
0

By setting these properties you should get what you want:

suppressCellSelection = true;
suppressRowClickSelection = false;
rowSelection = "multiple";
Alexander Zbinden
  • 2,315
  • 1
  • 17
  • 21
0
.ag-row-focus { 
    background-color:white;
}

This works for me.

0

All the above got me in the right direction, except I needed to add !important to the style to override the current css. I am using NextJS, threw the styling into a .css file, and imported it in the NextJS _app.tsx file.

So...

.ag-row-focus { 
    background-color: #ff0000 !important;
}