This repository has been archived by the owner on Sep 6, 2018. It is now read-only.
Send the row index into a rowFilter function #24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since the sortable table performs its sorting internally it is not possible to do any client-side paging while maintaining the global sort order for all of the data in the table.
This PR addresses that by adding a
rowFilter
function which allows for any type of filtering, but specifically includes a sort index to be used for paging.I slightly prefer a previous attempt where I modified the
rowAttrs
to take the sort index allowing one to setdisplay: none
, which is better for screen readers. This would also allow one to make dynamic changes to the styling based on the sort index of the row.Unfortunately this required a change in the render function from
lazy3
tolazy4
(which seems to be untenable?), or otherwise to completely change the schema being passed into the table (which seemed unwise).In the absence of a
lazy4
function I think that this is the simplest change that makes sense for introducing client-side paging. Please let me know what you think, any comments are welcome!