slickgrid-universal icon indicating copy to clipboard operation
slickgrid-universal copied to clipboard

Enable/disable alternate rows highlighting

Open Konctantin opened this issue 1 week ago • 0 comments

Clear and concise description of the problem

Some grid instances don't needs to have alternate rows highlighting.

Suggested solution

We can add a new option to the grid settings like disableAlternateHighlighting or enableAlternateHighlighting and change a few lines in appendRowHtml function like this:

-      (row === this.activeRow && this._options.showCellSelection ? ' active' : '') +
-      (row % 2 === 1 ? ' odd' : ' even');
+      (row === this.activeRow && this._options.showCellSelection ? ' active' : '');
+ 
+    if (!this._options.disableAlternateHighlighting) {
+     rowCss += row % 2 === 1 ? ' odd' : ' even';
+  }

Alternative

No response

Additional context

No response

Validations

  • [x] Follow our Code of Conduct
  • [x] Read the Wikis.
  • [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Konctantin avatar Jan 16 '26 11:01 Konctantin