back again for some help.
I feel like this should be a really basic thing that I just can't seem to get to work.
I am loading some boolean values onclick of a button, and I'd like to default some checkboxes to checked if those are true.
Using
<template if:true={graValue}>
<lightning-input type="checkbox" label="(GRA)" onclick={handleEditRowSelection} value="GRA" checked ></lightning-input>
</template>
<template if:false={graValue}>
<lightning-input type="checkbox" label="(GRA)" onclick={handleEditRowSelection} value="GRA" ></lightning-input>
</template>
handleEditUser(event) {
this.graValue = event.target.dataset.gra;
this.rimValue = event.target.dataset.rim;
}
<lightning-button
variant="brand-outline"
icon-name="utility:preview"
label="Edit User"
name={user.Contact__c}
data-gra={user.GRA__c}
data-rim={user.RIM__c}
Always seems to default to true, even when the GRA value is false in the console log from that row button. I'm kinda at a loss as to what to do here.
Previously I tried setting the checked property on the input to be based on the value but am running into the same issue here.
When graValue = false, the checkbox is still displayed as checked even though the template should be rendering the unchecked one.
Any advice?