lundi 9 mai 2022

Kendo checkbox toggle true and false states not working properly

I know this is probably a pretty dumb question, and I apologize. I am pretty new to this all. I'm trying to get it so when one or more checkbox is clicked, I'm able to get a button to appear. I would like the toggle function to work if one or more checkbox is clicked, but instead it will turn on when I select one checkbox, then turn off during the next selection. I'm sure I've got a couple of unnecessary properties added into here as well, but not too concerned about that. Any help would be appreciated. Thank you!

HTML: Button

<button class="btn btn-primary"
*ngIf="switchCase" style="float:right"
>Save</button>

HTML: Checkbox Column

<kendo-grid-column field="checkbox" editor="boolean">
    <ng-template kendoGridCellTemplate let-dataItem id="flexSwitchCheckChecked"
    >
    <input type="checkbox" (click)="toggleButton(dataItem, 'checkbox' 
    [checked]="dataItem.checkbox"
    [width]="40"
      >

TS: Button click method

public switchCase: boolean = false;
  toggleButton() {
    this.switchCase = !this.switchCase;



Aucun commentaire:

Enregistrer un commentaire