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
5 comments:
Thanks for the example Roel. It was very helpful.
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
Hi 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
Hi 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
hi ,
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
Post a Comment