Nov 04, 2013, 4:41 PM
[CLOSED] GridPanel Cell Color Renderer
I have a renderer defined for select columns in a GridPanel as follows:
var linkRenderer = function (value, meta, record, index) {
if (value != 0) {
return Ext.String.format("<a class='company-link' href='#' onclick='linkClick({1},{2});'>{0}</a>", value, index, meta.columnIndex);
}
else {
return value;
}
};
I'm trying to modify it to also change the cell background color like this:var linkRenderer = function (value, meta, record, index) {
if (value != 0) {
metadata.tdCls = "tdRed";
return Ext.String.format("<a class='company-link' href='#' onclick='linkClick({1},{2});'>{0}</a>", value, index, meta.columnIndex);
}
else {
metadata.tdCls = "tdGreen";
return value;
}
};
This is the CSS:.x-grid-row .tdRed {
background-color: #FF0000;
}
.x-grid-row .tdAmber {
background-color: #FF9933;
}
.x-grid-row .tdGreen {
background-color: #00CC00;
}
.x-grid-custom .company-link
{
color: #0000FF;
}
But it doesn't work; the cell is just blank. What am I missing?
Last edited by Baidaly; Nov 04, 2013 at 7:10 PM.
Reason: [CLOSED]