I have two array of objects, selectedBandKind and selectedBandId. I am using them to select multiple checkboxes at the same time. I am also using them to show the desired icon. It is just an array of object and not collection.
I thought about using collection, but i needed to pass some arguments, so i am using click.delegate. In the click.delegate callback, i am changing the content of the array and i can see the change happening in console.log. But array is not reflecting the change in the View. Any idea why?
<div class="workflow-module-analysis-legend-data-cell" repeat.for="BandKind of BandKinds.All().splice(1)">
<a class="workflow-module-analysis-legend-checkbox ${selectedBandKind[$parent.$index] === BandKind && selectedBandId[$parent.$index] === measurement.id ? 'selected': ''}"
click.delegate="selectBand(measurement.id, BandKind, $parent.$index)"
title="Show ${BandKind.name} bands for '${measurement.name}.'">
<fa-icon icon="${selectedBandKind[$parent.$index] === BandKind && selectedBandId[$parent.$index] === measurement.id ? 'fas fa-check': 'fas fa-check-circle'}"></fa-icon>
</a>
</div>
and click.delegate function is
public selectBand(id: string, bandKind: BandKind, index: string): void
{
this.busy = true;
this.selectedBandId = this.selectedBandId === id && this.selectedBandKind === bandKind ? undefined : id
this.selectedBandKind[index] = bandKind;
this.busy = false;
}