So this is the full code for the select:
<div class="col-12 mt-2" dmx-hide="(varProgSelectVisible.value != 1)" dmx-animate-enter.duration:1500.delay:200="fadeIn" dmx-animate-leave.duration:1500.delay:200="fadeOut"
dmx-show="(varProgSelectVisible.value == 1)">
<dmx-array id="arrProgrammesSelected" dmx-bind:items="editStaffView.data.queryProgrammes.values(`programme_id`)"></dmx-array>
<dmx-array id="arrProgrammesSelection" dmx-bind:items="getProgList.data.getProgs.values(`programme_id`)"></dmx-array>
<select id="select1" class="custom-select" dmx-bind:options="getProgList.data.getProgs.where(`programme_id`, arrProgrammesSelection.items, "inArray")" optiontext="programme_name"
optionvalue="programme_id" name="updateStaffProgrammes"
dmx-on:changed.debounce:200="editStaffView.formUpdateStaff.arrProgrammesSelected.addUniq(value);;editStaffView.formUpdateStaff.arrProgrammesSelection.remove(value)">
<option selected="" value="" disabled>Select Programmes</option>
</select>
<div id="repeatProgSelect" is="dmx-repeat" dmx-bind:repeat="arrProgrammesSelected.items">
<div class="badge badge-pill" dmx-on:click="editStaffView.formUpdateStaff.arrProgrammesSelected.removeAt($index);editStaffView.formUpdateStaff.arrProgrammesSelection.addUniq($value)"
dmx-style:background-color="getProgList.data.getProgs.where(`programme_id`, $value, "==").values('programme_colour')">
{{getProgList.data.getProgs.where(`programme_id`, $value, "==").values('programme_shortcode')}} <i class="fas fa-times"></i> </div>
</div>
</div>
The array arrProgrammesSelection currently returns ALL programmes, I would like for it to exclude the programmes listed in arrProgrammesSelected. The on:change event in the select and on:click event in the badges manages the arrays on user interaction, it’s just looking for a way to populate the initial lists.
This is the kind of thing I think the array binding should look like, if I could just change the inArray to NOTinArray!
<dmx-array id="arrProgrammesSelection" dmx-bind:items="getProgList.data.getProgs.where(
programme_id, arrProgrammesSelected.items, "inArray==0").values("programme_id")"></dmx-array>
If anyone has any suggestions I’d be really grateful! I’ve tried not equal, it show the list perfectly to start but once a selection is made it only updates to the current selection. I think it would be achievable through flows but seems like a sledgehammer to crack a nut!