created: 20170206022431198
modified: 20191215042449992
revision: 0
tags: $:/tags/table/HeaderTemplate
tbl-column-list: tbl-checkbox
title: $:/plugins/aaldrich/tables/template/header/checkbox

<th style="width:1.4ch;text-align:center;" class="tbl-inpt-check">
  <$set name="allSelected" filter=<<checkboxFilter>> value="$:/plugins/aaldrich/tables/macro!!tbl-false" emptyValue="$:/plugins/aaldrich/tables/macro!!tbl-true">
    <$reveal type="match" state=<<allSelected>> text="false">
      <$button class="tc-btn-invisible" tooltip={{!!tbl-checkbox-tip}}>
        <$checkbox field="tbl-selall" unchecked="closed" default="closed"/>
          <$list filter=<<tableFilter>>variable="currentRecord">
            <$action-listops $tiddler=<<currentRecord>> $tags="+[append<checkTag>]" />
            <$action-setfield $tiddler=<<currentRecord>> $field=<<checkField>> $value=<<checkSel>>/>
            <<checkActions>>
          </$list>
        </$button>
      </$reveal>
      <$reveal type="match" state=<<allSelected>> text="true">
       <$button class="tc-btn-invisible" tooltip={{!!tbl-checkbox-tip}}>
         <$checkbox <$checkbox field="tbl-selall" checked="open" default="open"/>
         <$list filter=<<tableFilter>>variable="currentRecord">
           <$action-listops $tiddler=<<currentRecord>> $tags="+[remove<checkTag>]" />
           <$action-setfield $tiddler=<<currentRecord>> $field=<<checkField>> $value=<<checkUnsel>>/>
           <<checkUnactions>>
        </$list>
      </$button>
    </$reveal>
  </$set>
</th>