Adding ressorts for multi-selection of entries
We use combo-boxes for editing the ressorts and subressorts.
States
By using stateChanged, the combo-box offers two states:
- The combo-box shows the ressort (resp. subressort) when all the entries in selection have same ressort (resp. subressort) value.
- If one or more entries have different ressort (resp. subressort) values then "<various values>" is displayed.
Note that if the ressorts of the selected entries are not equal, the subressorts are reset.
Example Configuration
{{#form-container legacyController=legacyController
$changePerfect=false
$changeReady=false
$changeNoDelete=false
$changeInvalid=false
$changeDeleteDate=false
$changeBroadcastDate=false
$changeRessort=false
$changeSubressort=false
$changeAuthor=false
$changeEditor=false as |form|}}
{{#if editable}}
<table class="modern-table">
<tbody>
<tr><td>{{check-box checked=$changeRessort}}<label>Change Ressort:</label></td><td class="editable-field">
{{combo-box
stateChanged=$changeRessort
model=editModelArray
field="ressortObject"
options=legacyController.selectedTable.ressortsCache
optionIdPath="RessortNr"
optionLabelPath="Name"
mode="select"
ariaLabel="Select Ressort"
}}
</td></tr>
<tr><td>{{check-box checked=$changeSubressort}}<label>Change Subressort:</label></td><td class="editable-field">
{{combo-box
stateChanged=$changeSubressort
model=editModelArray
field="subRessortObject"
options=editModel.ressortObject.Children
optionIdPath="RessortNr"
optionLabelPath="Name"
mode="select"
ariaLabel="Select Subressort"
}}
</td></tr>
</tbody>
</table>
{{else}}
<table class="modern-table">
<tbody>
<tr><td>Ressort:</td><td>{{bulk-text-box model=model field="Ressort" readonly=true}}</td></tr>
<tr><td>Subressort:</td><td>{{bulk-text-box model=model field="SubRessort" readonly=true}}</td></tr>
</tbody>
</table>
{{/if}}
{{/form-container}}