typescript - Updating items in a grid with checkbox - ionic 2 -
i hope can me. have grid many columns , need update in database selected rows pressing button. can't find info this.
this code.
<ion-row *ngfor="let errors of eta_allerrorsrs"> <ion-col class="info-col col-align" col-1> eta </ion-col> <ion-col class="info-col" col-1> <ion-checkbox ng-model="active"></ion-checkbox> </ion-col> <ion-col class="info-col col-align" col-1> sli </ion-col> <ion-col class="info-col col-align" col-1> odbms </ion-col> <ion-col class="info-col col-align" col-1> {{errors.vc_codi_iata_pais}} </ion-col> <ion-col class="info-col col-align" col-2> {{errors.nb_oc}} + "/" + {{errors.fech_ins_eta}} </ion-col> <ion-col class="info-col col-align" col-4> {{errors.vc_error_envio_eta}} </ion-col> <ion-col class="info-col col-align" col-1> {{errors.fech_eta}} </ion-col> </ion-row> <ion-row> <ion-col class="info-col col-footer" col-12> <button ion-button class="button-footer" smerrors color="bluedark" (click)="republishconfirm()">republish</button> <button ion-button class="button-footer" smerrors color="bluedark" (click)="rejectconfirm()">reject</button> </ion-col> </ion-row>
thanks!!
from documentation, should use ngmodel this:
<ion-item> <ion-label>pepperoni</ion-label> <ion-checkbox [(ngmodel)]="pepperoni"></ion-checkbox> <button (click)="updatedatabaseclicked(errors)">clickonme</button> </ion-item>
then in ts file:
updatedatabaseclicked(errors){ writeintodatabase(this.pepperoni); }
Comments
Post a Comment