rowStyle
Description
Optional. Defines the style of a row in the tableUsage
rowStyle?: (row:{}) => string;
Parameters
The function takes the following parameters:
row
- an object with the row configuration, where key is the row ID:
{
[key: string]: any;
}
The function returns the name of a CSS class or an empty string.
Example
import { useRef } from 'react';
import { Grid } from "wx-react-grid";
const { data, columns } = getData();
export default function App() {
const api = useRef(null);
return (
<Grid
data={data}
columns={columns}
rowStyle={row => (row.id === 11 ? 'rowStyle' : '')}
footer={true}
api={api}
/>
);
}
:global(.rowStyle:not(.selected) .cell) {
color: white;
background: #0ebf6c;
}