lundi 6 mai 2019

How to obtain checkbox value using ng-model

While trying to implement Checkbox functionality,I am not able to obtain which checkbox the user has selected in a table.

The value for the checkbox comes as Y and N. The checkbox should be checked if the value is Y and unchecked if the value is N.

                    <tbody id="tablebody">
                        <tr id="trval" *ngFor="let x of csvData">
                            <td id="td"   (click)="click($event)"  contenteditable *ngFor="let y of x ;let j=index" 
                             [class.active]="i == selectedRow">
                                <i *ngIf="j==0" id="removeicon" class="fa fa-times-circle icon " aria-hidden="true" readonly="true" (click)="deleterow($event)"></i>
                                    <div *ngIf="j==23">
                                        <input type="checkbox" [(ngModel)]="x[j]" id="dppcheck" (click)="dppflagchecked()">
                                    </div>
                                    <div *ngIf="j!=23">
                                        
                                    </div>
                                </td>
                        </tr>
                    </tbody>




Aucun commentaire:

Enregistrer un commentaire