Hi Mat, I have vague memories that we may have discussed this in the past… here is an example of a template that allows you to have the same behaviour without a link to use as the drag handle:
<$draggable tiddler=<<currentTiddler>> tag="td">
<$text text=<<currentTiddler>>/>
</$draggable>
<td>{{!!number}}</td>
<td>{{!!text}}</td>
This is a quick example of a template using a field on the tiddler to determine if its draggable or not:
<$draggable tiddler=<<currentTiddler>> tag="td" selector=".draghandle">
<span class={{{ [{!!draggable}match[no]then[]else[draghandle tc-draggable]] }}} draggable={{{ [{!!draggable}match[no]then[false]else[true]] }}}><$text text=<<currentTiddler>>/></span>
</$draggable>
<td>{{!!number}}</td>
<td>{{!!text}}</td>
Lastly, here is a slightly tweaked macro to accept an optional parameter headers
in title list format:
\define list-rows-drop-actions()
<$action-listops $tiddler=<<tiddler>> $field=<<field>>
$subfilter="""+[enlist<newlist>]"""/>
<$action-listops $tiddler=<<tiddler>> $field=<<field>>
$subfilter="""+[insertbefore:start<actionTiddler>,<currentTiddler>]"""/>
\end
\define list-rows(rowTemplate:"$:/plugins/TWaddle/list-rows/defaultTemplate", tiddler, field:"list", class, headers)
\whitespace trim
<$let
tiddler={{{ [<__tiddler__>is[blank]then<currentTiddler>else[$tiddler$]] }}}
field="""$field$"""
>
<!-- SETUP IF UNDEFINED LIST -->
<$list filter="""[<tiddler>!has<field>]""">
<div style="outline:1px solid crimson; padding:1px 18px;">
<$edit-text
tiddler="$:/temp/list-rows"
tag=input
placeholder="enter filter"
size=40
/>
<$set
name="listcontent"
filter={{{ [{$:/temp/list-rows}] }}} >
<$button
set="$:/temp/list-rows"
setTo="">
<$action-setfield
$tiddler=<<tiddler>>
$field$=<<listcontent>> />
<$action-setfield
$tiddler=<<tiddler>>
$field$-filter={{$:/temp/list-rows}} />
populate
</$button>
</$set>
- Populates the //$field$// field in <$link/>
[[$rowTemplate$]] is the rowTemplate. The currentTiddler variable refers to the current list item:
<br>
<$edit-text tiddler="""$rowTemplate$""" placeholder="""Enter the <td> definitions for $rowTemplate$""" class="list-rows-rt-editor" size="100%"/>
</div>
</$list>
<!-- end SETUP -->
<table class="list-rows $class$">
<$list filter="[<__headers__>!is[blank]]">
<tr>
<$list filter="[enlist<__headers__>]">
<th><$text text=<<currentTiddler>> /></th>
</$list>
</tr>
</$list>
<$let
targetList={{{ [<tiddler>get<field>] }}}
targetFilter={{{ [<tiddler>get[$field$-filter]] }}}
>
<$list filter="""[subfilter<targetFilter>sortby<targetList>]""">
<$set name=newlist filter='[subfilter<targetFilter>sortby<targetList>]'>
<$droppable
actions=<<list-rows-drop-actions>>
tag="tr">
<$transclude tiddler="""$rowTemplate$"""/>
</$droppable>
</$set>
</$list>
</$let>
</table>
</$let>
\end