-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Table widget #296
Comments
Yes, this is highly desired! We have |
Alright, I've looked at Grid and tried laying out some data in it! Of the things you mentioned and the things I've thought, here's a couple things that are probably easy to do:
I've also read some about laying out tables, and realized that a table where you can merge arbitrary cells has a slightly different purpose to a filterable kind of table. The former is more for displaying data that has partial hierarchy, the latter for displaying spreadsheet-like data. So perhaps merging and laying out tables can be a separate layout method to the existing & augmented |
Explored a bit more. It seems like it's surprisingly annoying to allow a different background color for the header row, because the way rows are composited. If I try to set the header row color before painting the row, I obviously don't know how high the row should be. I can instead set the entire rect's background color to the header row, and draw another rect for the rest of the rect after I finish writing the header row. I think that should work. |
@skairunner |
I'm working on writing a custom table widget right now since I have need of one in an application. It is a work in progress and I'm also just learning egui, so the implementation might be terrible right now, but here it is: https://github.com/sagebind/smplinfo/blob/master/src/ui/widgets/table.rs. That might help as a starting point. Here's what it looks like right now anyway: I ended up not basing it off of
This isn't really |
I'll try to go over it to add some customization to Grid and build a more flexible Table widget. |
I haven't had the time to look at this, but @sagebind makes a good case for having a table as a separate thing from |
hi,Is there table widget added now? |
It would be nice to have more feedback on the usability of my proof of concept, so feel free to test it and leave feedback in the pull request! |
Hi, would image in table cell be supported? |
#963 has been merged. It doesn't quite support everything mentioned in this issue, but it is a really solid foundation to build on, so I will consider this issue closed and then we can open new issues (or PR:s) to fix the remaining things (like clicking/selecting rows and columns). |
Is your feature request related to a problem? Please describe.
I want to display data that is tabular, e.g. a list of buy & sell requests in a market, with quantity, expiry time, price, and name.
Describe the solution you'd like
A widget that allows the user to easily display tabular data, including headers, would be great. Filtering/sorting features as well as alternating row colors would also be nice.
One consideration is that it would be nice to be able to have clickables inside table cells -- there are a lot of uses for that, even if they aren't relevant to me particularly. Additionally, some way to merge headers or cells or have sub-headers would probably also be nice to have.
Implementing a nice API for this is not going to be trivial, but there is some prior work available to draw off of, e.g. Javascript libraries for tables.
Describe alternatives you've considered
As far as I can tell, there are no ways to do this at the moment, other than having non-aligning text elements.
The text was updated successfully, but these errors were encountered: