mleibman / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
6.82k stars 1.98k forks source link

Added 'selected' class to selected row. #1060

Closed bbankowski closed 1 year ago

bbankowski commented 9 years ago

There was no way to customize CSS for selected rows, as it didn't have 'selected' style.

6pac commented 9 years ago

The 'selected' style is applied to all the columns in the row (unless the column has 'selectable:false').

See http://mleibman.github.io/SlickGrid/examples/example9-row-reordering.html

woru commented 9 years ago

When fullWidthRows option is set to true, odd, even and active rows are styled but you have no way of styling the selected row.

See the example: http://jsfiddle.net/fxt81gu1/5/ The last 'empty' column cannot be styled as selected.

6pac commented 9 years ago

My point was that the 'selected' css styling is applied to the cells in the row, not the row div itself.

I haven't really tried the fullWidthRows option, but that appears to be adding empty space to the right, not a blank column. The alternating row style spills over into that space.

To add selected row styling would be a departure from how it's currently done. Not sure that's gonna make it into the trunk.

woru commented 9 years ago

By "empty column" I mean the empty space which can also hold scroll bar. I don't understand why 'active' class can be applied to the row (in addition to cells) but 'selected' cannot.

I presume that in most use cases developers care about selected row not cell.

It's very strange that e.g here http://jsfiddle.net/hu6x8p7y/4/ you cannot style the whole selected row (barring hacks with getItemMetadata).

I don't say that class has to be named 'selected' it can be 'selected-row' or anything I just think that this is an inconsistency in slickgrid api.

6pac commented 9 years ago

I agree with you it's a bit inconsistent. Perhaps this is worth adding so we get both selected-row and selected-cell classes. I might add it to my repo (the 'alternate master', check it out).

I really doubt that MLeibman will add this pull request to the trunk, though.