for odd, even and selected you should use a style, not the onRender event. Have a look at the style sample, for example:
selected {
background-color: #3D80DF;
}
odd {
background-color: #f0f0f0;
}
even {
background-color: #FFFFFF;
}
foundset.clear();
var _d = new Date();
foundset.loadAllRecords();
application.output(new Date() - _d);
function onRender(event) {
if (event.isRecordSelected()) {
event.getRenderable().bgcolor = '#00ff00';
} else if (event.getRecordIndex() % 2) {
event.getRenderable().bgcolor = '#ff0000';
} else {
event.getRenderable().bgcolor = '#000000';
}
}
john.allen wrote:(Although onRender did seem to change the label background color in Chris's case who started this thread).
Harjo wrote: (btw what you do in onRender, will override the CSS)
odd
{
background-color: #FFFFFF;
}
function onRender(event)
{
/**
* @type {JSRecord<db:/gevs/psi_gevs_reservas_solicitudes>}
*/
var rec = event.getRecord();
if(rec) {
event.getRenderable().bgcolor = '#80ff00';
}
}
juan.cristobo wrote:Harjo wrote: (btw what you do in onRender, will override the CSS)
I don't know why, but it doesn't work for me
In my CSS I have this:
- Code: Select all
odd
{
background-color: #FFFFFF;
}
And I have this method attached to onRender event of the field:
- Code: Select all
function onRender(event)
{
/**
* @type {JSRecord<db:/gevs/psi_gevs_reservas_solicitudes>}
*/
var rec = event.getRecord();
if(rec) {
event.getRenderable().bgcolor = '#80ff00';
}
}
Bgcolor of all rows (odd and even) should be #80ff00, but it's always #FFFFFF in odd rows.
Return to Discuss possible Issues and Bugs
Users browsing this forum: No registered users and 19 guests