2023-03-04 11:48:14 +00:00
created: 20230301174431218
list: efg hlm pqr
2023-08-08 08:52:39 +00:00
modified: 20230805103601224
2023-03-04 11:48:14 +00:00
myfield:
revision: 0
2023-08-08 08:52:39 +00:00
tags: ActionListopsWidget
2023-03-04 11:48:14 +00:00
title: ActionListopsWidget (Examples)
type: text/vnd.tiddlywiki
In this example we shall populate and then clear a list in an ordinary field (myfield) of this tiddler (the default).
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $field="myfield" $filter="efg hlm pqr"/>
Populate 'myfield'
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="abc xyz"/>
Append More Items
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="-abc -hlm"/>
Remove Items
</$button>
<$button>
<$action-listops $field="myfield" $filter="[[]]"/>
Clear 'myfield'
</$button>
<$list filter="[list[!!myfield]]">
</$list>"""/>
---
In this example we shall append and remove items from a list in an ordinary field (myfield) of this tiddler (the default) and sort the resultant list. We shall then remove some of the appended items and sort the resulting list in reverse order.
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $field="myfield" $subfilter="-efg ijk xyz [[this is a title]] +[sort[]]"/>
Mangle List
</$button>
<$button>
<$action-listops $field="myfield" $subfilter="-xyz -[[this is a title]] +[!sort[]]"/>
Unmangle List
</$button>
<$list filter="[list[!!myfield]]">
</$list>"""/>
2023-08-08 08:52:39 +00:00
---
The following example toggles the tag <<.value Examples>> for the current tiddler.
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $tags="+[toggle[Examples]]"/>
Toggle 'Examples' tag
</$button>
"""/>
2023-03-04 11:48:14 +00:00
---
In this example we shall append a few tags to the 'tags' field of this tiddler (the default). We shall then remove some of the appended tags.
<$macrocall $name='wikitext-example-without-html'
src="""<$button>
<$action-listops $tags="+[append{Days of the Week!!short}] $:/tag1 $:/tag2 $:/tag3"/>
Populate 'tags'
</$button>
<$button>
<$action-listops $tags="+[!remove:2{!!tags}]"/>
Remove Last Two Tags
</$button>
<$button>
<$action-listops $tags="+[!prefix[$:/]]"/>
Remove System Tags
</$button>
<$button>
<$action-listops $tags="-Mon -Tue"/>
Remove Mon and Tue
</$button>
<$button>
<$action-listops $tags="+[prefix[$:/]] ActionWidgets Widgets"/>
Remove User Tags
</$button>
<$button>
<$action-listops $tags="+[[]] ActionWidgets Widgets"/>
Clear Tags
</$button>
<$list filter="[list[!!tags]]">
</$list>"""/>