Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate column names causes only last columns' data to be returned #42

Open
OVO-Josh opened this issue Apr 17, 2023 · 3 comments
Open

Comments

@OVO-Josh
Copy link

If I have a grid with say the columns [Requested, Settled, Requested, Settled] Only the data from the last two columns is returned.

So for | Requested | Settled | Requested | Settled |
| 10 | 5 | 6 | 8 |

A call to getAgGridData() would return [{"Requested": 6, "Settled": 8}]

In most scenarios where this occurs I imagine the user will have some group headers to differentiate between the columns themselves - so I propose adding the group header names to the column names to get around this.

So for | Total Price | Total Volume |
| Requested | Settled | Requested | Settled |
| 10 | 5 | 6 | 8 |

We'd get [{"Total Price Requested": 10, "Total Price Settled": 5, "Total Volume Requested": 6, "Total Volume Settled": 8}]

I currently have a working fix for this locally - happy to put up a PR to add it if wanted?

@kpmck
Copy link
Owner

kpmck commented Jun 1, 2023

Hey @OVO-Josh ! So sorry for the delayed response. I will carve out time this week to take a look and will respond shortly.

If you have a working fix, please feel free to put up a PR if you’d like!

@nealeu
Copy link

nealeu commented Oct 8, 2024

Any progress on this? We've got the same problem to work around.

If this is proving too complex, perhaps a simple alternative or option for getAgGridData() to return the cells keyed by columnId instead of columnName.

@kpmck
Copy link
Owner

kpmck commented Nov 18, 2024

Hey @nealeu and @OVO-Josh! Apologies for the delay in responding, I've been preoccupied with other projects at the moment and haven't had a chance to come back and resolve some of the open issues. I am hoping to be able to do so soon, but in the meantime I am welcoming any PRs and will review ASAP if anyone is able to tackle them before I can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants