Row Odd
RowOddPlugin
Section titled “RowOddPlugin”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:
beforerowrenderEvent Hook: Decorates row VNodes withodd,even,row-stripe,data-row-stripe-index, anddata-row-source-indexattributes.- Configurable striping: Supports odd, even, custom interval/offset, custom row class, and predicate-based striping.
- Runtime updates: Reads direct
grid.rowOddconfiguration and legacyadditionalData.rowOdd.
Usage:
- Add
RowOddPluginto the grid plugin list. - Optional: configure
grid.rowOddoradditionalData.rowOdd.
Example
Section titled “Example”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',};RowOddConfig
Section titled “RowOddConfig”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.