I think you might want to set the style names rather than keep adding them.
Or at least remove one style name before adding another
Ian

http://examples.roughian.com


2009/9/28 tachoknight <tachokni...@gmail.com>

>
> Hi all-
>
> I am trying to build a table/grid in a loop and want to color rows
> based on CSS for a particular status setting:
>
> if (row.getSeverity() == 1)
> {
>        grid.getRowFormatter().addStyleName(currentRowNum, "critical");
> }
> else if (row.getSeverity() == 2)
> {
>        grid.getRowFormatter().addStyleName(currentRowNum, "warning");
>        grid.getRowFormatter().addStyleName(currentRowNum, "warning");
>        grid.getRowFormatter().addStyleName(currentRowNum, "warning");
>        grid.getRowFormatter().addStyleName(currentRowNum, "warning");
> }
> else
> {
>        grid.getRowFormatter().addStyleName(currentRowNum, "normal");
> }
>
> This "works" if the final else clause is missing, except when the grid
> is re-drawn, and that particular row stays red ("critical") even
> though the message has been shifted down a row (which is now a row
> that is not colored red because it wasn't colored red before). If the
> "else" clause is there, as it is in the code above, the row is "never"
> colored red (or yellow/"warning").
>
> I know I'm not pushing the functionality envelop here, but for some
> reason I'm clearly not "getting it" in terms of handling the grid/
> table. Is there a proper way to do what I'm trying to do?
>
> Thanks for any info,
>
> Tacho
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to