Send the row index into a rowFilter function#24
Send the row index into a rowFilter function#24rehno-lindeque wants to merge 1 commit intoevancz:masterfrom
Conversation
This allows one to do client-side paging on a table while maintaining the sort order given by the columns.
Could you expand on why that is better for screen readers? |
|
I think that a similar argument applies as to the |
|
I'm still misunderstanding exactly why you want |
|
You'd use a class if you cared about accessibility, rather than inline .visually-hidden {
display: none;
}
@media print {
.visually-hidden {
display: block;
}
}
@media speech {
.visually-hidden {
display: block;
}
}Pretty useful for printing pages also. Anyway, it really just boils down to the old presentation versus semantics argument, that one should not pin down the presentation directly in html (which is for content), but via styling instead. |
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
rowFilterfunction 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
rowAttrsto 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
lazy3tolazy4(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
lazy4function 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!