Return to Snippet

Revision: 5744
at March 31, 2008 22:32 by arunpjohny


Initial Code
grid.getView().getRowClass = function(record, index){
    return (record.data.change<0.7 ? (record.data.change<0.5 ? (record.data.change<0.2 ? 'red-row' : 'green-row') : 'blue-row') : '');
};

.blue-row .x-grid3-cell-inner{
    color:blue;
}
.red-row .x-grid3-cell-inner{
    color:red;
}
.green-row .x-grid3-cell-inner{
    color:green;
}

Initial URL
http://www.hastentechnologies.com/blog/post/ExtJs-Tips-for-GridPanel-Row---Marking2c-Colouring2c-Focusing--Special-Key-Event-Firing.aspx

Initial Description
getRowClass changes the row CSS properties its applied for, but inside a row each cell element will have its own CSS class again.

Initial Title
Grid row colouring

Initial Tags

                                

Initial Language
JavaScript