Page 1 of 1

[REACT] Grid Row add CSS class

Posted: Mon Aug 08, 2022 2:39 pm
by tikhonov.a.p

Good afternoon. I can't find a way to add some css class to all rows in grid.
Tried using onTaskDataGenerated and taskRenderer
It turned out to be done only through the renderer on the column, however, this method has a flaw - it only works when a column is added to the display (

Tell me where to look.


Re: [REACT] Grid Row add CSS class

Posted: Mon Aug 08, 2022 2:44 pm
by tikhonov.a.p

found beforeRenderRow event


Re: [REACT] Grid Row add CSS class

Posted: Mon Aug 08, 2022 3:04 pm
by marcio

Hi tikhonov.a.p

Yes, if you want to add some validation to add or not a class based on the record value, beforeRenderRow is the one that you'll be using to update the cls field.

https://www.bryntum.com/docs/grid/api/Grid/view/GridBase#event-beforeRenderRow
https://www.bryntum.com/docs/grid/api/Grid/row/Row#config-cls

If you don't need to add any validation and just add some class to all the rows, you can use the column cls property
https://www.bryntum.com/docs/grid/api/Grid/column/Column#config-cls