基于价值变动的ExtJS网格单元格背景 [英] extjs change grid cell background based on value
本文介绍了基于价值变动的ExtJS网格单元格背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我申请一个渲染到我的网柱,
但背景颜色不发生变化:
I applied a renderer to my grid-column, but the background color is not changing:
renderer: function(value, meta) {
if (parseInt(value) > 0) {
meta.tdCls = 'category-matching'; return value;
}
else {
meta.tdCls = 'category-not-matching'; return value;
}
}
CSS:
.x-grid-cell .category-matching {
background-color:green;
}
.x-grid-cell .category-not-matching {
background-color:red;
}
我也试过
.grid-cell-inner
和
background-color:red; !important
,但没有效果。
任何想法?
推荐答案
试试这个...
renderer : function(value, meta) {
if(parseInt(value) > 0) {
meta.style = "background-color:green;";
} else {
meta.style = "background-color:red;";
}
return value;
}
这为我工作。
这篇关于基于价值变动的ExtJS网格单元格背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文