I have 2 columns like TPF and TPF_FLAG which i get from my rest service. TPF_FLAG will be 0 or 1 which indicates that should i change the background color of TPF cell or not. If it 1 that TPF cell background should be red. How do i do this?
Asked
Active
Viewed 31 times
1 Answers
1
You can use the renderer on the column like this:
{
text: 'TD',
dataIndex: 'TPF',
renderer: function (value, metaData, record) {
if(record.get('TPF_FLAG') == 1){
metaData.tdStyle = 'background-color: red';
}
return value;
}
}
And note, that the value you return from the renderer will be shown in the column.
Also, you can look at the docs for more things you can do with renderer
.

Gašper
- 815
- 8
- 14
-
Can a add class to metaData instead of writing style directly? – Hacker Sep 12 '16 at 03:43