Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How do you apply alternating styles to groups of records?

    v9.0p_2014-07-12/PowerEdition

    I am trying to override the styling used for grouped records. I have disabled the alternate record styles. My ListGrid will always be grouped, and I want each group of records to alternate background color like in the attached image.

    I've tried overriding getBaseStyle() and using some math to perform the styling - which works until I start collapsing groups. Then the row numbering can no longer be used with my formula, as it depends on one group always using 9 rows in the grid.

    Is there a way in your API to set a style for a group at a time? Or do you have any other ways to approach this?
    Attached Files

    #2
    You could override getCellStyle() and return a styleName based on the group value of the record

    Comment


      #3
      Where do I find the group value? I don't see an attribute in the ListGridRecord at runtime, and I don't see a getter method for this on the ListGrid or ListGridRecord API.

      Comment


        #4
        Nevermind, that one should have been obvious. :)

        Comment

        Working...
        X