Grid row colouring


/ Published in: JavaScript
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.