ghiscoding / Angular-Slickgrid

Angular-Slickgrid is a wrapper of the lightning fast & customizable SlickGrid datagrid, it also includes multiple Styling Themes
https://ghiscoding.github.io/Angular-Slickgrid
MIT License
392 stars 117 forks source link

Grouping interface getter property type #430

Closed gregoryfikator closed 4 years ago

gregoryfikator commented 4 years ago

I'm submitting a Feature request

Motivation / Use Case

I'm trying to group by column with complex object data but grouping.interface doesn't allow me to set function as getter. Using default string from column field which points to exact property doesn't seem to work for me as I'm getting groups with [undefined] value.

Slickgrid's dataview can handle getter as function, so my question is if getter property of Grouping Interface shouldn't take string or (value: any) => string?

obraz obraz obraz obraz

Expected Behavior

Allow string or function returning string as parameter for getter property of Grouping interface by changing getter?: string to getter?: string | (value: any) => string

Other Information

Setting any accepted type instead of Grouping for my setGrouping argument makes it working so the interface property type is the only one obstacle . I think interface should also consider this case.

ghiscoding commented 4 years ago

I wasn't aware that it could take a function, it's hard to cover every cases since SlickGrid doesn't have any Typing, I added all of them by what I see available at the time of creating the feature.

So please go ahead with a Pull Request if possible.

ghiscoding commented 4 years ago

This is now available in latest version 2.18.x.

Please upvote ⭐ if you haven't already. Cheers