Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

227
Views
Kendo checkbox toggle true and false states not working properly

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.

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;
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

pass an event to your function then access its value from typescript class: Step1(pass an $event): on *ngFor tag level add an index var

<div *ngFor="let item of items;let i = index" >
    <input type="checkbox" (change)="toggleButton($event,i)">
</div>

Step1(get its value):

      toggleButton($event,i) {
    let newValue = $event.target.value;
       // this.switchCase =newValue;

this.items[i].checked =  newValue;
    }
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!