Code:
Ext.create('Ext.grid.Panel', { ... viewConfig: { getRowClass: function(record) { return record.get('age') < 18 ? 'child-row' : 'adult-row'; } } });

  

Code css样式:

 .child-row .x-grid-cell { background-color: #ffe2e2; color: #900; }
 .adult-row .x-grid-cell { background-color: #e2ffe2; color: #090; }

  


 
 
ext 4.0.7版本用以上方法才可以改变行背景颜色。
使用一下方式的css在ext 4.0.7版本中无效:
.child-row { background-color: #ffe2e2; color: #900; } .adult-row { background-color: #e2ffe2;

相关文章:

  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-01-24
  • 2021-08-09
  • 2021-04-10
  • 2022-01-03
  • 2022-12-23
相关资源
相似解决方案