glide-data-grid icon indicating copy to clipboard operation
glide-data-grid copied to clipboard

More customizable trailing row

Open pzcfg opened this issue 4 years ago • 6 comments

Currently trailingRowOptions lets you specify the hint text, as well as whether it is sticky or tinted, but it would be great to have some more customizability, such as:

  • a custom icon instead of just the "+"
  • which column to show the hint on
  • hiding the icon on other columns
  • force the append action to focus/edit a particular column

pzcfg avatar Feb 03 '22 21:02 pzcfg

I really like the idea of the customizability!

bryhasagithub avatar Feb 03 '22 23:02 bryhasagithub

I'm not too familiar in data-grid but I think the trailingRow should be converted to a JSX component/DOM element instead if this level of customizability was wanted to be supported.

There is no need to have it as canvas because it's just one DOM element and DOM/jsx is far more configurable for end developers.

GSheets does this as well for other stuff like the highlighting overlay and such.

MartinDawson avatar Feb 14 '22 19:02 MartinDawson

Horizontal scrolling would get out of sync if we did that.

jassmith avatar Feb 14 '22 23:02 jassmith

Hey @pzcfg, I implemented a few changes to help with trailing row customization: https://github.com/glideapps/glide-data-grid/pull/178 and https://github.com/glideapps/glide-data-grid/pull/179

That should cover this issue, except for

force the append action to focus/edit a particular column

which I'll think about, and perhaps tackle in another issue

ivoelbert avatar Feb 18 '22 16:02 ivoelbert

This looks great, thank you! Would it also be possible to add a way to hide the animated plus on the other columns? It seems like one option would be to pass in an icon that is blank, but it would be cleaner to have an option to not draw anything in the first place.

pzcfg avatar Feb 18 '22 17:02 pzcfg

This looks great, thank you! Would it also be possible to add a way to hide the animated plus on the other columns? It seems like one option would be to pass in an icon that is blank, but it would be cleaner to have an option to not draw anything in the first place.

Yeah, for now the "solution" is to use a blank icon. I'll think about a way to make a less crapy solution. One very easy change that we could do is add an "empty" icon into our default spritemap, so you don't have to ship your own, at least.

ivoelbert avatar Feb 18 '22 17:02 ivoelbert