Skip to content

Row Odd

The RowOddPlugin adds configurable row striping during row rendering. By default it preserves the classic behavior and marks rows 1, 3, 5... with the [odd] attribute.

Functionality:

  • beforerowrender Event Hook: Decorates row VNodes with odd, even, row-stripe, data-row-stripe-index, and data-row-source-index attributes.
  • Configurable striping: Supports odd, even, custom interval/offset, custom row class, and predicate-based striping.
  • Runtime updates: Reads direct grid.rowOdd configuration and legacy additionalData.rowOdd.

Usage:

  • Add RowOddPlugin to the grid plugin list.
  • Optional: configure grid.rowOdd or additionalData.rowOdd.
import { RowOddPlugin } from '@revolist/revogrid-pro';
const grid = document.createElement('revo-grid');
grid.plugins = [RowOddPlugin];
grid.rowOdd = {
mode: 'custom',
interval: 3,
offset: 1,
className: 'finance-band',
};
type RowOddMode = 'odd' | 'even' | 'custom';
interface RowOddConfig<T = any> {
enabled?: boolean;
mode?: RowOddMode;
interval?: number;
offset?: number;
className?: string;
match?: Partial<T>;
shouldStripe?: (context: RowOddContext<T>) => boolean;
}

Use rowOdd: false to disable striping without removing the plugin.