Change Row Background Color After setCellStyleProvider

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Change Row Background Color After setCellStyleProvider

Postby ginofranco » Thu Oct 06, 2011 5:36 am

I have a situation where the table/grid was configured to have row stripes but I also have a use case where I should change the background color of the row afterwards with some conditions.
I tried changing the background color using setBackground from the swing library but it doesn't change anything. I tried doing setForeground and it was working fine.
Is changing the background color after setting the row stripes possible?
ginofranco
 
Posts: 2
Joined: Thu Oct 06, 2011 5:27 am

Re: Change Row Background Color After setCellStyleProvider

Postby JIDE Support » Thu Oct 06, 2011 6:28 am

Please let your original table model implement StyleModel then return a CellStyle with different background. Please also invoke CellStyle#setPriority() to set a higher priority than 0. As long as you turned style on via row stripe or StyleModel, cell renderers will have background which obsolete the table.getBackground().

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Change Row Background Color After setCellStyleProvider

Postby ginofranco » Thu Oct 06, 2011 6:40 am

Thank you for the response.

Do you have any example from that?
ginofranco
 
Posts: 2
Joined: Thu Oct 06, 2011 5:27 am

Re: Change Row Background Color After setCellStyleProvider

Postby JIDE Support » Thu Oct 06, 2011 6:44 am

Please give JIDE AbstractStyleTableDemo a try for the detailed implementations.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 10 guests

cron