Additional Data table / Glideapps datagrid features #3025
Replies: 3 comments 11 replies
-
The table it self is read-only by design (it's an output). If it was editable, the user would expect the underlying variable to change, which we wouldn't do (we can't easily mutate, and we definitely wouldn't want to for reproducability reasons). In Livebook, the way to have UIs that "mutate" something is via Smart cells. Smart cells are UI components that generate code. For example we have "Data transform cell", where you specify a source dataframe variable, then use the UI to apply modifications, but underneath it generates actual (which the user can see), that code runs and produces the updated data frame. I'm not sure how a Smart cell would look for editing individual cells, or rather, what code would that generate. One option would be a blank sheet where you enter data and it generates Elixir code with a corresponding data structure. Either way, I think it would be a whole separate thing. |
Beta Was this translation helpful? Give feedback.
-
Ok, I somehow get the point with reproducability reasons. My usecase:
Not sure how a smart cell would help in the mentioned scenario. Could you pls elaborate? KISS is kind of a requirement. |
Beta Was this translation helpful? Give feedback.
-
I believe his use case is for a Livebook app, not a Livebook notebook. Assuming that's the context, Smart cells don't seem like the right approach. Maybe a custom Kino.JS.Live component would be better. Out of curiosity, here's a Kino for inputting data as a table: https://hexdocs.pm/kino_table_input/readme.html Additionally, but not related to editing data, I've already been thinking about a growing need for a more interactive data grid component. For admin-related tasks, it is common to display data in a table, then be able to select a row and do something with that selection. Here's a real example where an interactive data table would help me: CleanShot.2025-06-27.at.08.45.41.mp4In this app, I search for orgs that match a name, then I want to click on an org from the table and show related info below. But I can't programmatically react to clicking an org. Nor can I add a "show related data" column to that data and react to clicking that action link. So, the alternative solution was to show the data, and have an input below where I can copy an ID from that org and submit it in a form to show related data. I'm just mentioning this other use case because it might be relevant to the overall topic of "interactive data tables". |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I'm currently trying to extend the glideapp features of the kino datatable. In particular cell edits and copy & paste. As enabler for google sheets style usecases.
https://github.com/adiibanez/kino/blob/main/lib/kino/table.ex#L198
Having a bit of a hard time in understanding how components play together rsp. how to best extend the datatable functionality.
Question: How to process "granular" cell value updates while respecting existing datastructures ( assigns data_rows / slicing_cache / content -> data ). Updating the complete tabular data for every single edit feels a little wasteful.
Beta Was this translation helpful? Give feedback.
All reactions