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

Cannot Filter on Nested Data using LocalPlugin #847

Open
archy-bold opened this issue Feb 1, 2019 · 1 comment
Open

Cannot Filter on Nested Data using LocalPlugin #847

archy-bold opened this issue Feb 1, 2019 · 1 comment

Comments

@archy-bold
Copy link

archy-bold commented Feb 1, 2019

Griddle version

1.13.1

Expected Behavior

Entering a query in the filter box which matches a nested field should return the row with that data.

Actual Behavior

Entering a query in the filter box which matches a nested field returns no results.

Steps to reproduce

Run the storybook and browse to the 'with nested column data' story. Enter 'hawaii' in the filter, observe there are no results.

Pull request with failing test or storybook story with issue

Can be reproduced from the storybook.

Edit: it appears this last worked in v1.11.2

@archy-bold archy-bold changed the title Cannot Filter on Nested Data Cannot Filter on Nested Data using LocalPlugin Feb 1, 2019
@archy-bold
Copy link
Author

So having delved into this a little, it appears the reason for this is that rather than allow filtering on all base (non-nested) columns except those with fllterable set to false, it now ignores any column, without ColumnDefinition set. ie if a column isn't defined in the ColumnDefinitions it's not filtered on at all.

A workaround is to define your nested property as a non-visible column, so it's included in the list of columns to filter. This performs toString() on the nested Map or List object, exposing all the properties.

<ColumnDefinition id="location" visible={false} />

It doesn't feel like starting with the base properties and then filtering those based on the columnProperties is the right way round, especially considering this will mean all nested properties will be ignored.

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

1 participant