In APEX, using an 'old-fashioned' report, you can create alternating row colors out of the box. But when you want to use the Interactive Report (IR) features, you can't do that anymore. But some people still have that need, according to this question on the Forum.
The main problem is that you can filter and re-order the resultset on the fly, so you can't define the coloring using the onload method of the page, because that's only fired once.
But when you have a Link Column in your report you can use the onload event of the image in that link :
<img src="#IMAGE_PREFIX#edit.gif" alt="" onLoad="Alternate(this);">
And define in your Page HTML Header:
The main problem is that you can filter and re-order the resultset on the fly, so you can't define the coloring using the onload method of the page, because that's only fired once.
But when you have a Link Column in your report you can use the onload event of the image in that link :
<img src="#IMAGE_PREFIX#edit.gif" alt="" onLoad="Alternate(this);">
And define in your Page HTML Header:
You can see the colorful result here: http://apex.oracle.com/pls/otn/f?p=ROEL:ALTERROW
Comments
One thing that didn't work for me was the line:
$(pThis).parent().parent().parent().addClass(lastColor);
I got an error that said "$ is not defined."
I had to use this line instead:
pThis.parentNode.parentNode.parentNode.className = "even";
Thanks Again,
Martin
I forgot to tell I use jQuery - I get so used to it I don't even notice it anymore - , and these are jQuery functions.
Roel
Thanks for all your examples, they are great!
Have you tried this Row Colors functionality with IE e.g. 6.0?
It works fine in Firefox 3.0 but I can't successfully use with IE :(
Best regards,
Algis
i m new to apex and i m developing small application in apex ... in this application i want to have alternating row colors .. can u explain this in a broad way ... it might helpful for peoples like me who starting to study apex..
Thanxs in advance,
ram