Presenting: list-table-draggable - drag'n drop rows of data

345 views
Skip to first unread message

Mat

unread,
Apr 24, 2021, 9:14:00 AM4/24/21
to TiddlyWiki
"Don't be a square. Be a table." 
- Aristotle

The TWaddleur proudly presents....
list-table-draggable
~ structured data in draggable rows ~

Where the core macros list-links-draggable and list-tagged-draggable merely shows each list item as the title, the rendered list, list-table-draggable lets you show each list item as a row with complex data.

The data is presented in a table e.g styled like tab-separated values:

tsv.png

...and, as noted, you might want to drag'n drop to rearrange them.

<:-)

P.S I think this functionality should be possible by default in TW. Do you agree?

Hans Huber

unread,
Apr 24, 2021, 9:52:26 AM4/24/21
to tiddl...@googlegroups.com
Maybe itshould rather be an official plugin in order to keep the default version slim?

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a2231911-5d1d-42a1-a81d-57d9f1697685n%40googlegroups.com.

Mohammad Rahmani

unread,
Apr 24, 2021, 10:46:20 AM4/24/21
to tiddl...@googlegroups.com
Mat,
 Nice idea! Clever solution!

One minor comment: (ignore)
In the demo page of plugin I tried reorder rows in example two and then I saw other examples updated! I know the reason!
But I suggest what do you think if a stateTiddler or variable is used here so it keeps tables independent!



Best wishes
Mohammad


--

History Buff

unread,
Apr 24, 2021, 3:47:34 PM4/24/21
to TiddlyWiki
I like this. However, in the examples, I tried to arrange one through four top to bottom and could never get there. I may have not been doing something right, but the behavior didn't seem consistent from one drop to the next.

Mat

unread,
Apr 24, 2021, 4:41:21 PM4/24/21
to TiddlyWiki
@note2 - yeah, perhaps an official plugin. Or maybe something like the list-links macro could be replaced with a more generic solution to present items with a template.

@Mohammad - yes, as you understood, updating one list also updates the other lists that use the same list field. I kind of think there is some value in seeing this to think that very thought. 

@History Buff - Darn, I agree; something is not working with the DnD! I have to look into this. Thanks for reporting.

<:-)

Mat

unread,
Apr 24, 2021, 5:10:34 PM4/24/21
to TiddlyWiki
Updated v.0.0.7

Drag'n drop reordering should now work properly.
Thanks @History Buff.

<:-)

Brian Cary

unread,
Oct 6, 2022, 9:54:36 AM10/6/22
to TiddlyWiki
This Draggable Table deal is SWEET!  I started incorporating it into all sorts of places in my Tiddlywiki.

One issue though, it doesn't seem to "update" correctly.  I'm using it for a task list, and when I check a task off as "done" (tagged with "Done") the table row should no longer appear in the table because it does not match the filter any longer. That only works so long as I have never "dragged" the line item.

Once I drag the table row to a new spot in the table, the filter that populates the table doesn't seem to apply any more, and my table row (that should disappear) remains in the table.
Maybe I'm missing something?

Hope you keep working on this fantastic plugin, and thank you for making it!

Mat

unread,
Oct 6, 2022, 3:02:44 PM10/6/22
to TiddlyWiki
Hi Brian and good to hear you like it.

First off, let me recommend that you join the main group for TW at https://talk.tiddlywiki.org/  - I saw this post there because all posts here on gg get reposted there, but not vice versa. It is the new official main forum for TW.

With that said; You're right in your observation. I believe it should be solvable but it is a bit complex so I'll need to return to think about how to solve it, earliest in the weekend (but I can't make any promise). Here's the difficulty:

As you know, the displayed rows in the table are based on the output from your custom filter, which is stored in the `list-filter` field. Each title creates a table row but because you can reorder the table rows, the order is arbitrary and thus has to be statically stored, which is done in the `list` field. 

But it is of course important that if a new tiddler qualifies in the filter, it should also show up in the resulting table. So the table rows are generated from BOTH the static list and the list-filter. This means that when you uncheck "done" in your tiddler then it no longer qualifies in the list-filter... but the title is still in the static list field! Again, this field has to be static to keep track of your arbitrary sort order.

What I should probably do is to add an action when an item is drag'n dropped to weed out all titles in the list field that don't qualify in the list-filter. There's just a nagging feeling that I've pondered over this and decided against it, but I'm not sure and I can't remember why I'd do that. (I.e why would I want items that don't qualify in the filter?)

Incidentally, as I've now quickly reviewed the code (and realized it is pretty complex) I note that I've also put in a qualified that each filter output has to be an *existing* tiddler. I wonder if this is a wise requirement. But it does mean that if you *delete* your done actions, they will disappear from the table. Not sure you'd want that but just sayin'.

Anyway, I'll have to get back to this, hopefully this weekend but no promise.

And do consider switching over to - or at least joining - the https://talk.tiddlywiki.org/ forum.

<:-)
Reply all
Reply to author
Forward
0 new messages