Apr 12, 2012, 1:21 PM
[CLOSED] SummaryRenderer Fn in 2.0
Hi,
I have a grid and need to compare column1 vs column3, column2 vs column4.
All four columns are summary columns.
If the values are the same, set one color; otherwise, set another color.
Here is the code in 1.3.
In 2.0 the parameters for SummaryRenderer Function seems different.
Thank you.
I have a grid and need to compare column1 vs column3, column2 vs column4.
All four columns are summary columns.
If the values are the same, set one color; otherwise, set another color.
Here is the code in 1.3.
function colorChange(value, metadata, record, rowIndex, columnIndex) {
var col1Value= Ext.util.Format.number(record.data.colnum1, "0,000,000.00");
var col3Value= Ext.util.Format.number(record.data.column3, "0,000,000.00");
var dataIndex = clientBlocksPanel.colModel.getDataIndex(columnIndex);
if (dataIndex == "column1" || dataIndex == "column3") {
value = Ext.util.Format.number(value.toFixed(2), "0,000.00");
} else if (dataIndex == "column2" || dataIndex == "column4") {
value = Ext.util.Format.number(value, "0,000");
}
if (record.data.column2!= record.data.column4 || col1Value != col3Value) {
return '<div class="x-grid3-cell-inner" style="background-color:#FFCC33"><span style="color:black;">' + value + '</span></div>';
} else {
return '<div class="x-grid3-cell-inner" style="background-color:#00CC66"><span style="color:black;">' + value + '</span></div>';
}
}
How the above code can be implemented in 2.0?In 2.0 the parameters for SummaryRenderer Function seems different.
Thank you.
Last edited by Daniil; Apr 16, 2012 at 12:08 PM.
Reason: [CLOSED]