Comment by crab_galaxy
2 days ago
The simplest would be to follow the aria role=“grid” spec, ideally with sortable columns. IMO it doesn’t need the kitchen sink AG Grid approach just a sane way to semantically build a data grid with proper accessibility.
https://www.w3.org/WAI/ARIA/apg/patterns/grid/examples/data-...
It has to handle every possible use case for a grid. You’re thinking of your use case. The spec needs to handle everything else. I don’t see how that’s manageable.
Does it though?
A good spec really only needs clear principles. At a minimum, it should clearly explain what it does do, and also clearly explain what it does not do.
You don't need to have every edge case covered to build an API for datagrids. iOS has had native DataGrids for ages, Windows, macOS, Android. They all have this stuff built in. Other platforms have figured out how to provide these API surfaces.
Why does the web have to be seen as a special unicorn that can't have good baseline components like these platforms?
Are any of the examples you gave an open standard with multiple implementations from different companies? If Apple gets their implementation wrong, they can always deprecate an API and move forward. If they want to throw out an old implementation and deprecate that completely and start over, they can do that. The Web standard depends on agreement by multiple large organizations. That level of communication slows everything down. If they get an API wrong, we’re stuck with it forever.
That’s why the web is a special unicorn. It’s very different than those platforms. Web standards should be small and composable. They shouldn’t try to solve every problem. I get why you would want a data grid. Maybe in your work it’s a common pattern. But on the broader web and in all of the documents that are out there, it’s on a minute fraction of them. It’s simply not worth the effort. Too much effort, too little gain.
At minimum filtering and sorting should be handled by the browser, including async for both of those.
Pagination could be argued as well, but at least that's simple-ish to implement (but still, it's such a common UI pattern that it ought to be handled in a unified way by browsers IMO)
Look at how much effort has gone into just getting a stylable select box. Look at tooltips. A data grid is several orders of magnitude higher in complexity than both of these. You are severely underestimating the complexity of your ask. HTML/JS/CSS is not supposed to solve all your UX problems. It’s a toolkit for building UIs, not a framework.
3 replies →