-
Notifications
You must be signed in to change notification settings - Fork 63
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
Added filterFields to Sorting #162
Conversation
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
=========================================
Coverage ? 76.87%
=========================================
Files ? 112
Lines ? 4558
Branches ? 275
=========================================
Hits ? 3504
Misses ? 847
Partials ? 207
Continue to review full report at Codecov.
|
Can you explain the use case a little more, and perhaps provide an example? |
Use Case: We have a search field that allows for filtering records in the grid and we want to maintain that filter when remote sorting. Unless I'm overlooking something, we currently don't have a way to pass along those extra values we want to be maintained to the the remoteSort so when you sort it returns the unfiltered data. Our setup is:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changeset looks good. 1 thing I'd like changed (see comment). I'd also like to see filterFields added to the readme. Would you mind adding that?
src/actions/GridActions.js
Outdated
return dataSource( | ||
{pageIndex}, | ||
filterFields, | ||
sortParams |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes a breaking change if filterFields is ordered before sortParams, whereas it's probably just a minor change if it comes second. Do you think it's OK if we keep the order as it was before, appending the new arg?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this to include group pageIndex and pageSize as a pagingParams object to match pager's setPageIndexAsync's pattern: dataSource({ pageIndex, pageSize }, filterFields, sortParams)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will have to be a breaking change to either doRemoteSort or setPageIndexAsync. I chose to change doRemote sort since it seems likely that doRemoteSort will have the smallest impact and the pattern for setPageIndexAsync seems more self explanatory.
Changes look good, would you mind updating the docs? |
Passing filterFields and pageSize to ColumnManager
Purpose: We want to be able to pass an object containing fields for filtering, like search terms, to the sort to allow for remote sorting to maintain those filters.
Concerns: