Hi all -- I decided to do a bit of enhancement to ...
# show-and-tell
e
Hi all -- I decided to do a bit of enhancement to the observable framework tables to make them responsive and editable. It includes support for adding/removing rows, dropdowns in column, and stringify'd parsing (I wanted to store/edit parameters in a text dict in column). I'm calling it
LiveTable
. Here's a demo that reviews the approach and column primitives (you set data types by column). Here's the actual code. I've found it useful, perhaps others may, as well!
f
It's really nice. Are you persisting the data in anyway, or is it lost on reload?
e
Thanks! Right now, the only way to persist on reload is to set the 'initialData'. It will not save state on reload though... so if you change the table and refresh, it'll default back to normal. That would be awesome, though, is that possible? How would one do that?
t
simplest is using local-storage https://observablehq.com/@tomlarkworthy/local-storage-view (you don;' have to do it with a view, thats just one way of using local storage) Here is another https://observablehq.com/@mbostock/safe-local-storage
🙌 1
e
I’m having a terrible time getting this to work. @Fil - if you’re interested in using this down the road in observable more broadly, I’ll open a GitHub issue. Else, I’ll continue to fight…