enableFullRowSelection turns off enableRowHeaderSelection?
According to the documentation, http://ui-grid.info/docs/#/tutorial/210_selection
"f you want to allow both clicking on the row, and also clicking on the rowHeader, you can set enableFullRowSelection to true."
I tried to do that: http://plnkr.co/edit/W8G2Bpp64msV9sCvYFSc?p=preview
But I can only select the row by the row body, not the header.
How can I enable selection by both the row body and header?
It appears that class ui-grid-disable-selection is being set to all .ui-grid-cell. That class applies the following CSS property to row headers specifically, but not to non-header cells:
.ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell {
pointer-events: none;
}
Setting pointer-events: none; prevents the click handler from firing when clicking the row header, thus the rows selected state does not toggle. This class is applied from the function registerRowSelectionEvents().
Reading the documentation, it seems that only enableFullRowSelection should be used for your desired result. enableRowSelection enables row selection for the entire grid. enableFullRowSelection enables the entire row to be clicked for row selection. enableRowHeaderSelection is true by default and simply toggles the visibility of the selection headers.
That being said, enableFullRowSelection does not work as expected because of pointer-events: none;.
A workaround would be to override the css with your own:
.ui-grid-cell.ui-grid-disable-selection.ui-grid-row-header-cell {
pointer-events: auto;
}
Plnkr fork showing this: http://plnkr.co/edit/N6vJ5b37ulfpfumAkjxs?p=preview
I can confirm the problem and that the workaround works. Thanks.
@Atmos206 Thanks for the workaround!
@dereklin No problem!