My users like being able to resize columns to their preference, but they would like it even more if they could drag 'n drop to rearrange the column order. I've been marinating on doing a PR for this, but I'd like to throw the request out there in case someone gets to it before me. (I had an existing solution for our old table library, but it kinda sucks.)
Also, I'd like to mention that my users absolutely love these tables now that I've got them almost fully tricked out. We get regular compliments on them, and it's nice being able to provide them a quality feature with super extensible, easy development.
Have you looked at dragula? That's how I've been doing drag and drop with these tables. I just combine that library with custom components. I'd love for this to be a baked in feature, but this has been working for me.
Thanks for the tip! I will check it out.
This is on our wish list as well, but we have not yet implemented anything in the core so as to not bloat the library. Technically it is possible using the existing API (we prefer a power API over including the kitchen sink in the core library). @iteria, could you please post your solution here? Or even better, you could develop a new story in the documentation using dragula. :)
Here's a codepen with a barebones example of how it works. This won't work if the columns have headers. Someone will have to figure that one out.
Thanks for this codepen @Iteria ! I had to add direction: 'horizontal' to the Dragula's options to avoid a subtle bug when resizing the headers.
Most helpful comment
Here's a codepen with a barebones example of how it works. This won't work if the columns have headers. Someone will have to figure that one out.