effad
23 Apr 2009, 5:16 AM
I have written a custom grid renderer which sets the background of the cell. However, if the row is selected I want the background of the cell to be rendered in "selection color".
One can reproduce the situation by adapting the array-grid.js example:
// example of custom renderer function
function change(val, metadata){
if(val > 0){
metadata.attr = 'style="background:green"';
}else if(val < 0){
metadata.attr = 'style="background:red"';
}
return val;
}
// example of custom renderer function
function pctChange(val, metadata){
if(val > 0){
metadata.attr = 'style="background:green"';
}else if(val < 0){
metadata.attr = 'style="background:red"';
}
return val + "%";
}
The attachment illustrates the problem.
Has anyone a good idea how to achieve this?
One can reproduce the situation by adapting the array-grid.js example:
// example of custom renderer function
function change(val, metadata){
if(val > 0){
metadata.attr = 'style="background:green"';
}else if(val < 0){
metadata.attr = 'style="background:red"';
}
return val;
}
// example of custom renderer function
function pctChange(val, metadata){
if(val > 0){
metadata.attr = 'style="background:green"';
}else if(val < 0){
metadata.attr = 'style="background:red"';
}
return val + "%";
}
The attachment illustrates the problem.
Has anyone a good idea how to achieve this?