How to create editable data table? #128
Replies: 1 comment
-
We don't natively listen on double clicks (since the terminal doesn't either), so that part might be a bit tricky. Otherwise it shouldn't be impossible, though there are a few issues. Do you need to have different-sized cells? PTG struggles with that kind of application, as the builtin Layout system doesn't handle it super well. The way I'd go about doing it is to have your application body be a set of Window objects, each with their own InputField. You can arrange these using the layout system (hence using individual windows instead of a single custom widget). Then I'd bind Alternatively you could probably create a simple grid layout relatively easily, but PTG's implementation is probably too domain-specific to be of much use for reference. Equal layouts aren't hard to achieve, if you have to introduce variable sizing you'd have some issues. Heads up; I'm working on a replacement/massive improvement over this library in the background, and it should be available within the next few months (at least as an early version). That library has a much better layout system, one that is per-widget so can implement these behaviours a lot better. It's still a bit too early to release to the public, but once I have a few things figured out I will alert people here as well. If that's too long of a wait, check out Textual's DataTable. They handle these situations a lot better for now. P.S. Sorry for the delay; life got in the way of things. |
Beta Was this translation helpful? Give feedback.
-
I want it when a user presses enter or double-click on any cell in the table. That cell will with the input field, and after filling in data when a user press enters, it submits and saves data and reflects it on a data table. I need guidance on how to achieve this.
I have reviewed the discussion but I think my case is a bit different.
Beta Was this translation helpful? Give feedback.
All reactions