I have a grid named ‘grid’ and onload there are rows being insert into the grid. Some Rows will be in green will be successfully input rows while rows with a background color of red will have errors. I had it working at some point but the error rows would be added to the grid w their background color red. Then when i tried to add a new row to enter new data into that all the rows went white. And then that stopped working all together. I’ve tried
store.insert(0, r).addClass('error-row');
and
Ext.fly(grid.getView().getRow(0)).addClass('error-row');
and
var cls ='error-row'
addRowClass : function(rowId, cls) {
var row = this.getRow(rowId);
if (row) {
this.fly(row).addClass(cls);
}
}
and
grid.getView().getRowClass = function(record, index, rp ,store) {
return 'error-row';
};
I’m unsure of what to do.
css
<style>
.error-row .x-grid-cell {
background-color: #990000 !important;
}
.new-row .x-grid-cell {
background-color: #F5F2F3 !important;
}
</style>
The viewConfig property should point you in the right direction – using code from Ext’s sample for grid, adding:
The code looks like this: