Skip to content

Row Odd

RowOddPlugin

The RowOddPlugin is a RevoGrid plugin designed to enhance the visual styling of grid rows by automatically applying an “odd” CSS class to every odd-numbered row. This allows developers to easily apply custom styling to differentiate odd rows from even ones within the grid interface.

Functionality:

  • beforerowrender Event Hook: Listens to the beforerowrender event to modify the attributes of the virtual node being rendered. It checks the row index and assigns the “odd” class to every row with an odd index, enabling targeted CSS styling.
  • Integration with Grid Core: Leverages core grid functionalities provided by PluginProviders for seamless integration and manipulation within the RevoGrid environment.

Usage:

  • To use the RowOddPlugin, instantiate it by passing a reference to the revo-grid element and the necessary providers. This setup will automatically apply the “odd” class during row rendering.

Example

import { RowOddPlugin } from '@revolist/revogrid-pro';
const grid = document.createElement('revo-grid');
grid.plugins = [RowOddPlugin];

This plugin is particularly useful for developers looking to implement alternating row styles for improved readability and aesthetic appeal in data grid presentations.

class RowOddPlugin {}