openpsa / jsgrid

Fork of last jqGrid version before license change
http://openpsa.github.io/jsgrid/
Other
28 stars 12 forks source link

Add support for CSS-only zebra striping #16

Open flack opened 9 years ago

flack commented 9 years ago

Currently, it is not possible to implement CSS-only zebra striping, because hidden rows (e.g. collapsed groups or collapsed child levels) have the same classes as visible ones. So if you have a CSS rule like

.ui-jqgrid-btable tr.jqgrow:nth-child(2n+1)
{
    background-color: gray
}

it will only work in simple cases, but it will produce wrong results if some of the rows are hidden.

So I would propose adding a class like jqrow-visible to all visible rows, then we could write

.ui-jqgrid-btable tr.jqgrow-visible:odd
{
    background-color: gray
}

without needing altrows and altclass config options