Serenity: Grouping in Grid for Enum

Created on 17 May 2018  路  2Comments  路  Source: serenity-is/Serenity

Hi, I have added grouping on Enum field,

        buttons.push(
            {
                title: 'GroupBy Status',
                cssClass: 'expand-all-button',
                onClick: () => {
                   this.view.setGrouping(
                    [{
                        getter: 'Status'
                    }])
                }
            }
        );

Here on the grid after grouping, I'm getting
image

How can i get Description of Enum instead of number

community-support question

Most helpful comment

user enum formatter

this.view.setGrouping(
                    [{
                        formatter: x => Serenity.EnumFormatter.format(Serenity.EnumTypeRegistry.get(enumKey), Q.toId(x.value)),
                        getter: 'Status'
                    }])

All 2 comments

user enum formatter

this.view.setGrouping(
                    [{
                        formatter: x => Serenity.EnumFormatter.format(Serenity.EnumTypeRegistry.get(enumKey), Q.toId(x.value)),
                        getter: 'Status'
                    }])

Thankyou @dfaruque , it worked awesome, thankyou once again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

john20xdoe picture john20xdoe  路  3Comments

Akarsh03 picture Akarsh03  路  3Comments

dkontod picture dkontod  路  3Comments

Shraddha996 picture Shraddha996  路  3Comments

Pinellus picture Pinellus  路  3Comments