Filter Repeating section displays according to criteria within the repeating items itself.Note: This technique was put together by Fenrhir, I have just been polishing it and implementing it in my sheet.
I have a tabbed section to organize/display spells. All the 1st circle spells are displayed under tab 1, all the 2nd circle spells under tab 2, Etc.
There were several downsides, among them was that the 10 circles involved 10 separate lists and code repeated 10 times. It was also not possible to see all the spells at once.
I experimented with hiding entries, but the small narrow border frame appears for each item not displayed.
Fenrhir came up with a way to combine all these lists, but filter the display so that only certain ones appear. The ones that do display appear normal. The ones that do not display don't leave any unwanted artifacts.
The HTML looks something like this.
<span class="sheet-fixed-width" style="width: 11em;"><b> Spell List </b></span><br>
<input type="radio" name="attr_tab-spells" class="sheet-tab sheet-spells-tab0" value="0" title="All circles" checked style="margin-left:1px;"/>
<span class="sheet-tab sheet-spells-tab0">All</span>
<input type="radio" name="attr_tab-spells" class="sheet-tab sheet-spells-tab1" value="1" title="Circle 1"/>
<span class="sheet-tab sheet-spells-tab1">Circle 1</span>
<input type="radio" name="attr_tab-spells" class="sheet-tab sheet-spells-tab2" value="2" title="Circle 2"/>
<span class="sheet-tab sheet-spells-tab2">Circle 2</span>
<input type="radio" name="attr_tab-spells" class="sheet-tab sheet-spells-tab3" value="3" title="Circle 3"/>
<span class="sheet-tab sheet-spells-tab3">Circle 3</span>
<div class="sheet-section sheet-section-sp-list">
<fieldset class="repeating_spell">
<input type="radio" name="attr_SP_Circle" class="sheet-hidden sheet-spells-tab0" value="0" checked />
<input type="radio" name="attr_SP_Circle" class="sheet-hidden sheet-spells-tab1" value="1"/>
<input type="radio" name="attr_SP_Circle" class="sheet-hidden sheet-spells-tab2" value="2"/>
<input type="radio" name="attr_SP_Circle" class="sheet-hidden sheet-spells-tab3" value="3"/>
<div class="sheet-filtered-box">
<span><select name="attr_SP_Circle" class="sheet-nowrap sheet-label-down" style="width:5em;">
<option value="0" selected title"Please choose the circle for this spell.">-</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>Circle</span>
<span class="sheet-nowrap">
<input name="attr_SP_Name" type="text" style="width:12em;" placeholder="Spell Name" ></span>
More fields.
</div>
</fieldset>
</div>
The relevant part of the css looks like this.
div.sheet-section-sp-list {
max-height: 999999px;
visibility: visible;
opacity: 1;
transition: opacity 0.5s linear 0s;
overflow: hidden;
}
.charsheet .repcontainer .repitem, /* A filterbox should look exactly like a repitem. */
.sheet-filtered-box {
padding: 5px 5px 2px 5px;
margin: 5px;
border: 2px solid #CCCCCC;
border-radius: 3px;
}
.repcontainer .repitem {
overflow: hidden;
}
.sheet-section-sp-list>fieldset.repeating_spell+.repcontainer>.repitem { /* A repitem within a spellslist should functionally not exist, it's place is taken by a filterbox. */
padding: 0px;
margin: 0px;
border: none;
border-radius:;
}
.sheet-filtered-box { /* By default, display no items of a filter box */
display: none;
}
/* Decide which specific repitems to display. */
input.sheet-spells-tab0:checked~.sheet-filtered-box, /* Always display all spells of circle zero. */
.sheet-spells-tab0:checked~.sheet-section-sp-list>fieldset.repeating_spell+.repcontainer>.repitem .sheet-filtered-box, /* When tab0 is checked, display everything no matter what which of the inner boxes are checked. */
.sheet-spells-tab1:checked~.sheet-section-sp-list>fieldset.repeating_spell+.repcontainer>.repitem input.sheet-spells-tab1:checked~.sheet-filtered-box,
.sheet-spells-tab2:checked~.sheet-section-sp-list>fieldset.repeating_spell+.repcontainer>.repitem input.sheet-spells-tab2:checked~.sheet-filtered-box,
.sheet-spells-tab3:checked~.sheet-section-sp-list>fieldset.repeating_spell+.repcontainer>.repitem input.sheet-spells-tab3:checked~.sheet-filtered-box {
display: block;
}
So basically what this does is it makes a filterbox look exactly like a repitem.
By default, no filterboxes are displayed.
The last css entries basically say where tabX above the repeating field is checked, and the same radio button inside a specific repitem is checked, then display that item.
Edit: Modified css above to get rid of an extra set of delete buttons.