-
Notifications
You must be signed in to change notification settings - Fork 191
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
Native ability to sort a <table> #800
Comments
Goals: Gauge appetite for this functionality and OpenUI’s appetite for creating an explainer/alignment on a proposal. |
First, huge +1 on addressing the user need. Sorting, filtering etc should be possible declaratively, out of the box. This would also allow extensions to enable this functionality on any table on the web. Nit: I imagine the first thing to be ironed out would be how do we sort? Lexicographically is rarely useful for strings, but do we really want to duck type numbers, with all the localization implications this ensues? Perhaps we also need an enumerated attribute on Regardless of which heuristic we pick as the default for values, we'd need to provide some kind of escape hatch for when it fails. For example, we could introduce a In terms of research, beyond what libraries and frameworks do, we should also look at what productivity tools do, and what UI they expose. E.g. this is from Coda: |
Yeah, totally agree that this is useful. If someone wanted to start research on it there are volumes for sure of different attempts at this in markup - it would be useful to look at what variations there are and why. "HTML 5" early on had a But also, these have been in other markups at least as long that tried to do "richer tables" of all kinds that I think are worth study and efforts... Even currently there are 70 custom element "tables" that show up in the recent HTTP Archive crawl, for example https://rainy-periwinkle.glitch.me/permalink/5c27a16fa9188e838ce164e76ebcb0045e555315c5e878b736c9631e776d526c.html |
Another set of documentation for existing table sorting features is https://meta.wikimedia.org/wiki/Help:Sorting which documents sortable tables in mediawiki (which are quite complicated). |
@scottkellum on all table issues the Open UI CG agreed that an explainer in this CG makes sense. Would you be open to championing such an explainer for proposed solutions for the issues? |
@gregwhitworth thanks for the update. I really wish I had time but both work and personal responsibilities have been absolutely crushing lately. Apologies I feel like I dropped a big one on OpenUI's plate. I will likely have more time when my daughter starts daycare in 3 months if this can wait until then. If there are grants available I can focus more on this as work. |
For sorting I propose having Invokers could play a useful role here for allowing userland to add their own controls to do the sorting, rather than injecting UI elements that then would need styling via something like |
In the spirit of making common things easy, and complex things possible, I think the ideal would be if the UA created controls but the author could provide their own controls as well (via slots?). If all that's needed is to style the UA provided controls, |
There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label. |
In case this gets picked up again: The tricky part here is assuming that the table holds all the data. Eg, if I'm displaying a table of 'all' Wikipedia pages, it's unlikely that I've created a If I sorted the table by the 'name' column, descending, I'd expect the top row to display the Wikipedia page with the name that appears last when sorted lexicographically. I wouldn't expect it to display the Wikipedia page with the name that appears 100th when sorted lexicographically. That leaves a few options:
|
I think there's another possibility here which is to fire an event which can be |
I wonder how much crossover there is between "I want advanced table features" and "I'm not displaying all the data at once". |
Sorting a table is common functionality added to a table via JavaScript. It would be helpful to have this functionality natively added to tables.
Related material:
Possible solution: add an attribute to a of
sortable="true"
with a::marker
of up/down (like ) for un-sorted, ▼ for descending, and ▲ for ascending.The text was updated successfully, but these errors were encountered: