samedi 18 février 2017

Get values from a dynamic checkbox list

See my html:

<ion-item ion-item *ngFor="let item of items">
    <ion-label></ion-label>
    <ion-checkbox color="secondary"></ion-checkbox>
</ion-item>

My .TS:

this.database.executeSql("SELECT * FROM check_item", []).then((data) => {
        this.items = [];
        if (data.rows.length > 0) {
            for (var i = 0; i < data.rows.length; i++) {
                this.items.push({ id: data.rows.item(i).id, name: data.rows.item(i).name });
            }
        }
    }, (error) => {
        console.log("ERROR: " + JSON.stringify(error));
    });

I would like to retrieve the values from the checkbox and save it to a tablela. How can I get values from a dynamic checkbox list?




Aucun commentaire:

Enregistrer un commentaire