GriddleGriddle / Griddle

Simple Grid Component written in React
http://griddlegriddle.github.io/Griddle/
MIT License
2.5k stars 378 forks source link

row background colour based on row value while rendering #810

Open saravanannnallasamy opened 6 years ago

saravanannnallasamy commented 6 years ago

Griddle version

1.9.0

Expected Behavior

set background colour of rows based on a row value on rendering.

Actual Behavior

cant able to set background colour during rendering.

Is there any way to set different colours to row based on a row value,

`<Griddle data={this.state.result} plugins={[LocalPlugin]} sortProperties={sortProperties} styleConfig={styleConfig} pageProperties={{ currentPage: 1, pageSize: 50, recordCount: this.state.result.length }}

`

dahlbyk commented 6 years ago

As of #644 (griddle-react@1.4.0), RowDefinition supports passing a function to cssClassName that receives the Row props (example). If you need to calculate a more precise background color, it seems like we should be able to support a similar mechanism to generate style overrides for a given Row.