Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
166
rated 0 times [  171] [ 5]  / answers: 1 / hits: 36836  / 13 Years ago, mon, october 3, 2011, 12:00:00

How do I add custom CSS classes to rows in a data grid (Ext.grid.Panel)?



I'm using ExtJS 4.0.


More From » extjs

 Answers
6

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' : '';
}
},

...
});

[#89816] Friday, September 30, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
deanna

Total Points: 84
Total Questions: 86
Total Answers: 107

Location: Cyprus
Member since Wed, Dec 8, 2021
3 Years ago
;