How do I add custom CSS classes to rows in a data grid (Ext.grid.Panel
)?
I'm using ExtJS 4.0.
The way to do it is to define viewConfig
on the grid:
Ext.create('Ext.grid.Panel', {
...
viewConfig: {
getRowClass: function(record, index, rowParams, store) {
return record.get('someattr') === 'somevalue') ? 'someclass' : '';
}
},
...
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With