Conditional formatting on GroupTable cells

I’ve been working on adding conditional formatting to a column in a group table, but when I run the code no formatting is applied. I’ve stepped through it and confirmed the correct values are being returned. I have tried the GroupTable.GroupStyleProvider interface as well as the Table.StyleProvider interface both in the ready hook and the init hook. Here’s the StyleProvider source:

new Table.StyleProvider() {
                @Override
                public String getStyleName(Entity e, String property) {
                    if (e == null) {
                        return null;
                    }
                    if (property != null && property.equals("estimatedReceivedDate")) {
                        PermitRequest pr = (PermitRequest) e;
                        Date estRecDate = pr.getEstimatedReceivedDate();
                        if (estRecDate == null) {
                            return null;
                        }
                        DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                        LocalDate estRecLocalDate = LocalDate.parse(
                                df.format(estRecDate)
                        );
                        LocalDate now = LocalDate.now();
                        if (now.isAfter(estRecLocalDate) || now.isEqual(estRecLocalDate)) {
                            return "red-color";
                        } else if (DAYS.between(estRecLocalDate, now) <= conditionalFormattingCutoff) {
                            return "orange-color";
                        }
                    }
                    return null;
                }
            }

Hi.
Then the cell and row styles set in the application theme should be defined. Detailed information on creating a theme is available in Themes. For web client, new styles are defined in the styles.scss file. Style names defined in the controller, together with prefixes identifying table row and column form CSS selectors. Could you please check that you defined the styles in the CSS? See the example.

That was the issue, thank you. I had the styles defined for the rows, but not the cells.

2 Likes

No answer for this issue? I have the same question: conditional style for the grouped rows! Is it possbile?