Posted By

arunpjohny on 03/31/08


Tagged

extjs


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

paullorentzen
Anber


Grid row colouring


 / Published in: JavaScript
 

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

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

  1. grid.getView().getRowClass = function(record, index){
  2. return (record.data.change<0.7 ? (record.data.change<0.5 ? (record.data.change<0.2 ? 'red-row' : 'green-row') : 'blue-row') : '');
  3. };
  4.  
  5. .blue-row .x-grid3-cell-inner{
  6. color:blue;
  7. }
  8. .red-row .x-grid3-cell-inner{
  9. color:red;
  10. }
  11. .green-row .x-grid3-cell-inner{
  12. color:green;
  13. }

Report this snippet  

You need to login to post a comment.