swimlane / ngx-datatable

✨ A feature-rich yet lightweight data-table crafted for Angular
http://swimlane.github.io/ngx-datatable/
MIT License
4.63k stars 1.68k forks source link

[groupRowsBy] property does not support nested properties #1465

Open JustAnotherSoftwareDeveloper opened 6 years ago

JustAnotherSoftwareDeveloper commented 6 years ago

I'm submitting a ... (check one with "x")

[ X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter

Current behavior When using the [groupRowsBy] property, there are two issues 1) There is no supported use of nested properties 2) Due to the way JS maps work (by reference), using objects to group rows does not work

Expected behavior

[groupRowsBy] supports nested property in the same way the "prop" column does. Fortunately, you already have a method here https://github.com/swimlane/ngx-datatable/blob/master/src/utils/column-prop-getters.ts that does what you need. All that needs to be done is to refactor this to be more accessible, and call it when you're setting group array rows.

Reproduction of the problem

Unfortunately, the code sample template does not seem to be working. However, I'd be happy to answer any questions below

What is the motivation / use case for changing the behavior?

I want to group rows by a nested property. **Please tell us about your environment:**

OS: Ubuntu 16.04 IDE: VSCode Package Manager: NPM

beaulac commented 6 years ago

Nested properties used for column props are also not supported by summary rows.

madmurdok commented 5 years ago

Hey guys! How is going? Maybe you can merge a PR for this issue, because it is a really nasty situation when you work with complicated data and you have to group it by nesting props.