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 placeholder and numeric sorting #774

Open
zzz-code opened this issue Nov 24, 2017 · 5 comments
Open

Filter placeholder and numeric sorting #774

zzz-code opened this issue Nov 24, 2017 · 5 comments

Comments

@zzz-code
Copy link

Griddle version

1.9.0

Hi, is there an option to change the filter placeholdertext to something like search without writing a custom filter component? I think it is much overdone to add a custom component only to change the placeholder text.

Second thing is the way of sorting. For example if i have numbers it sorts like:

1
10
100
1000
2
3

instead of

1
2
3
10
...

How can I solve this?

@dahlbyk
Copy link
Contributor

dahlbyk commented Nov 29, 2017

is there an option to change the filter placeholdertext to something like search without writing a custom filter component? I think it is much overdone to add a custom component only to change the placeholder text.

Not currently, but this should be a relatively easy patch if you want to submit a PR:

  1. Add filterPlaceholder to initialState.textProperties
  2. Use textSelector in FilterContainer to add that value to props (e.g. PreviousButtonContainer
  3. Use the new props value in Filter

Once connected to textProperties, you can override the text from a plugin or directly.

Second thing is the way of sorting. For example if i have numbers it sorts like...

You can provide a custom sortMethod either for the entire grid or specific columns. Check out how this custom sort function is used in the Storybook.

@zzz-code
Copy link
Author

zzz-code commented Dec 1, 2017

If it is possible to change the textproperties for next and previous than it should also be possible to change other values like the placeholder. Let me try to find a workaround with the use of textSelector

@dahlbyk
Copy link
Contributor

dahlbyk commented Dec 1, 2017

I agree that it should be possible. And the Filter placeholder isn't the only example of hard-coded text that could be converted to use textSelector (e.g. NoResults, Loading).

If you're not interested in contributing, we'll try to fix this as time allows.

@Saldivarcher
Copy link
Contributor

I made a pr for the first issue 😸

@zzz-code
Copy link
Author

I'm curious and I will check it out

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

No branches or pull requests

3 participants