Draggable table rows - how?

159 views
Skip to first unread message

Mat

unread,
Mar 10, 2021, 2:58:11 PM3/10/21
to TiddlyWiki
I want to make tables with DnD rearrangable rows because the content has to be presented in neat columns.

I am trying to use the list-links-draggable macro for this: 

text:
<table>
<<list-links-draggable type:table subtype:tr itemTemplate:mytemplate>>
</table>
list: 
one two three four


title: mytemplate
text: <td><$link/></td>


It does result in a table but a lot of extra divs are added, ruining the table. It has this structure:

<table>
<tr class="tc-droppable">
   <div class="tc-droppable-placeholder"></div>
   <div><td>...first item..</td></div>
</tr>
<tr class="tc-droppable">
   <div class="tc-droppable-placeholder"></div>
   <div><td>...second item..</td></div>
</tr>
...etc...
</table>

What can I do to prevent this, or do I misunderstand something?

Is it a reasonable to request a new native macro for this? 

Thank you!

<:-)

Soren Bjornstad

unread,
Mar 19, 2021, 4:34:49 PM3/19/21
to TiddlyWiki
Hey Mat,

Just want to bump this as it's something I've found myself needing lately as well. I don't have a good solution, but it seems like having an option to not wrap each item in a div would be reasonable.

Mat

unread,
Mar 20, 2021, 4:24:34 AM3/20/21
to TiddlyWiki
Posted a request for this. Givet it a thumbs up if you support it.

I think it makes sense because the current "draggable" macros only treat single titles, not complex rows, which is very limiting. And lists with complex rows are a huge deal in TW.

<:-)

Mohammad Rahmani

unread,
Mar 20, 2021, 7:40:10 AM3/20/21
to tiddl...@googlegroups.com
Mat,
 I believe list-links-draggable is not a good choice! You need to use the $draggable widget directly! I remember Eric has several good examples and some good solutions (in reply to questions in this forum!) to start with. 

Note: You may also use div with display:table, or display:table-row and display:table-cell.
 


Best wishes
Mohammad


--
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/eb2f3d43-1b5b-4289-b0bd-c764c45c943cn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages