Fork me on GitHub
#hyperfiddle
<
2024-02-21
>
Will09:02:28

Heyo! I am trying to get a table (or something that looks like it) working in electric. Found some threads discussing the topic and ended up trying to emulate what you guys are doing in the https://electric-datomic-viewer.fly.dev/(:app.datomic-browser!attribute,:abstract%52elease!name) / https://github.com/hyperfiddle/electric/blob/master/src/contrib/gridsheet.cljc. Unfortunately, even with a barebones implementation using nothing but hardcoded data, it keeps glitching out upon scrolling down (see images). What is interesting is that if I replace the cells for-loop (https://github.com/hyperfiddle/electric/blob/master/src/contrib/gridsheet.cljc#L77) with a hardcoded div for each cell (since I know the number of columns in the test data) it will work perfectly fine. But any other way I have tried to make it work has ultimately been a failure. The value of scroll-top is jumping all over the place, so I initially thought that perhaps elements were being mounted before what was previously on the screen got unmounted (and with that bumping things out of place), but I think I was able to confirm this is not the case (with mount/unmount prints). Maybe you have some ideas about what is happening? I also noticed the todo deprecate comment at the top of the Gridsheet ns, and I have heard rumours about a fabled electric table you guys built. If possible, we would certainly be interested in having a look at that 👍

Will09:02:21

Lmk if you need any more information, or code snippets (although the barebones implementation was me going back and essentially making a carbon copy of the gridsheet code).

Will10:02:11

Thanks in advance 🙂

Will14:02:58

Decided to reduce scope of the project in the meantime, using a paginated table view (no infinite scroll). So no rush but still keen to hear/see your take on tables in electric.

Dustin Getz18:02:41

Haven't touched this in over a year but it looks misconfigured, the gridsheet requires some layout information injected from userland including a css-grid column config - https://github.com/hyperfiddle/electric-fiddle/blob/15639af98d15280d87a85af548650359660cc234/src/datomic_browser/datomic_browser.cljc#L51

Dustin Getz18:02:53

we do have feature complete and high quality application datagrids (see screenshots in our website) but they are for our consulting clients only at this point, they are not plug-n-play yet (harder to configure than the datomic browser for sure)

Will19:02:13

Alright thanks, good to know. Maybe we'll be in touch in the future then