-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Programmatically set sorting Column and Direction #761
Comments
After thinking about this for a while, I realized it might just be better to simply allow to take sorting Column and Direction as props. (Not just for initialization as in PR #649 ) |
@Olliebaba, we're looking for generally the same thing, except we need to do multi-column sorting (i.e., sort by lastName ASC then by firstName ASC then by birthDate DESC) |
@Olliebaba @jrnail123 |
@jrnail23 and @reno004 - I decided to write my own table plugin for the project i'm working on because requirements kept on drifting further from how react-data-grid operates. As far as multi column sorting, that would be in your |
@Olliebaba sorry for being naive....how do we show the multiple columns as sorted in the grid. Thanks in advance |
@reno004 - when you say multi-column sorting, how do you mean? If you post your question with more detail on stack overflow, I can try my best to help you but this isn't the correct platform to get into such details. Post on stack overflow and then reply with the link please. |
This feature has been merger #649 |
I need this merger, when will you publish next npm package containing this merge? Thanks. |
WHICH VERSION OF REACT ARE YOU USING?
WHICH BROWSER ARE YOU USING?
I'm submitting a ... (check one with "x")
Current behavior
Currently a user must click a column's header to trigger the handleSort method. (PR #649 addresses how to set initial sort through getInitialState)
Expected/desired behavior
Create external access to trigger sorting.
What is the motivation / use case for changing the behavior?
I would like to have access to this method so that I can set the column caret from a parent container in place of forcing CSS styles to show which column the data is sorted by.
I have a form which searches for contacts via various fields. I would like to sort the data based on which input fields have value. Since I have no means of triggering handleChange, the only way I am able to display sorting column and direction is by having additional checks on the parent's state and forcing CSS styles for the carets.
The text was updated successfully, but these errors were encountered: