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

Filter and sorting with nested array in object #98

Closed
azern32 opened this issue May 17, 2024 · 1 comment
Closed

Filter and sorting with nested array in object #98

azern32 opened this issue May 17, 2024 · 1 comment
Assignees
Milestone

Comments

@azern32
Copy link

azern32 commented May 17, 2024

I have data where the format goes like this

result : [
    0: {
      key1 : value1,
      ....,
      keyN : [
         0: {
              nestedN : valueN
         },
         1: {
              nestedN : valueN
         },
     ]
    },
    1: ...
]

The very top array will be the rows

How can I filter and sort by that "nestedN" ?

I tried using

{handler} orderBy={(row) => row.keyN.nestedN} 

but it failed to do so. I figure this must be because the data to filter were inside an array. Yet, all the examples I see using just object.

Any help?

@vincjo vincjo self-assigned this Jun 5, 2024
@vincjo vincjo added this to the 2.0 milestone Jun 5, 2024
@vincjo
Copy link
Owner

vincjo commented Jun 6, 2024

Just add to deep copy the input instead of shallow copy.
Added to 2.0

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

No branches or pull requests

2 participants