Replies: 1 comment 2 replies
-
There's two parts to this question: Firstly: Why isn't this code working? Well... because you haven't done anything to make it work. You've definitely subclassed The second part is the implied "bigger picture" question - could/should this be added to Toga? IMHO, No. if iOS/Web doesn't support the Table widget, then the fix is to implement the Table widget, not to implement a hacky workaround. Your assertion that this sort of box-based workaround is "better" than a native table widget is fundamentally incorrect. If you want proof of this, load 10k rows into your table. GTK, macOS and Windows will handle this without any significant difficulty. I'll almost guarantee that this implementation will crash - and if it doesn't crash, the performance will be so bad as to make you wish it had crashed. On top of that, a desktop-style Table rendition isn't the best way to present a table on a mobile platform. Mobile devices have limited screen real-estate, and are generally more constrained horizontally than vertically. Trying to display a classical "table" on a mobile device leads to a generally bad UX, because the content is difficult to view. The reason I can say this with confidence is that the Android implementation of table is, at present, based on a collection of clickable boxes. The performance is awful, to the extent that Toga's Table example project must be explicitly modified to run at all; and the UX is just as bad. It is for this reason that the Android implementation of Table is currently marked as "beta" - it badly needs to be replaced (see #1392). Yes - a table widget is needed on iOS and Web. A better implementation is needed on Android. This is something we want to address, but there's been a few pieces of groundwork that we needed to land first - most notably, the #2244 rework of apps. The connection between this refactor and the Table widget may not be obvious, but it exists: in order to build a high-performance and UX-compliant Table widget on iOS and Android, we need to modify the implementation to use native widgets that involve navigation - something we couldn't easily do until the core app had a better internal structure that could accomodate navigation widgets. |
Beta Was this translation helpful? Give feedback.
-
I made this modification to the
Box
widget, in the hope of replacingTable
with a bunch of clickable boxes stacked vertically or whatever the best elegant design leads us.Because
Table
does not exist on iOS, Web and even pagination, search are not supported out of the box.I feel stacked boxes are simpler and faster than tables, it will get us fine grain control and many great designs can be done with boxes on all platforms.
The code looks acceptable but it is not working.
What is missing here or elsewhere?
Beta Was this translation helpful? Give feedback.
All reactions