Skip to main content

rowStyle

Description

Optional. Defines the style of a row in the table

Usage

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

<script>
import { getData } from "./common/data";
import { Grid } from "wx-svelte-grid";

const { data, columns } = getData();

</script>

<Grid
{data}
{columns}
rowStyle={row => (row.id == 11 ? 'rowStyle' : '')}
footer={true} />

<style>
:global(.rowStyle:not(.selected) .cell) {
color: white;
background: #0ebf6c;
}
</style>