MakrelJohnson
5 Dec 2011, 9:16 AM
Hello, I've been struggling this morning with viewConfig in my Grid Panel setting styles based on cell value.
The style is being added but the styles are not rendering. ex: yellow background is not displaying, yet you can inspect element and it's built to have a yellow background.
viewConfig in the grid construction:
viewConfig: {
getRowClass: function(record, index, rowParams, store) {
var cls = '';
var data = record.data;
if (data.assignedto != '') {
cls = 'yellow-row';
}
if (data.cancelled != '') {
cls = 'red-row';
}
return cls;
}
},
Row as seen by Chrome. Note the 'yellow-row' class.
<tr class="x-grid-row yellow-row x-grid-row-selected"> ...</tr>
Am I missing a last command to apply the style? Nothing I've seen in the docs hints to this and I'd appreciate some direction.
Thanks!
The style is being added but the styles are not rendering. ex: yellow background is not displaying, yet you can inspect element and it's built to have a yellow background.
viewConfig in the grid construction:
viewConfig: {
getRowClass: function(record, index, rowParams, store) {
var cls = '';
var data = record.data;
if (data.assignedto != '') {
cls = 'yellow-row';
}
if (data.cancelled != '') {
cls = 'red-row';
}
return cls;
}
},
Row as seen by Chrome. Note the 'yellow-row' class.
<tr class="x-grid-row yellow-row x-grid-row-selected"> ...</tr>
Am I missing a last command to apply the style? Nothing I've seen in the docs hints to this and I'd appreciate some direction.
Thanks!