0
I put as options in ion-select, South zone, north, center and west. I want when I click on some option, to show only the information of that zone by taking the information from the database. At the moment I only have the same select.
<ion-item no-lines class="setaselect">
<ion-label stacked color="carioca" >REGIÕES</ion-label>
<ion-select>
<ion-option value="opt1"></ion-option>
<ion-option value="opt2">Zona Oeste</ion-option>
<ion-option value="opt3">Zona Norte</ion-option>
<ion-option value="opt4">Zona Sul</ion-option>
</ion-select>
DB.ts
getRegiao(pregiao: string){
return new Promise<Regiao[]>((resolve, reject) => {
let sql = "select * from tb_regiao" + pregiao;
console.log(sql);
this.executeQuery(sql).then(data => {
let regioes = [];
data.forEach(function (row) {
let regiao: Regiao = { nom_regiao: row[0]}
regioes.push(regiao);
});
resolve();
}).catch(error => {
console.log(error);
});
});
}
and my function ts.
selecionaregiao(pregiao: string) {
this.db.getRegiao(pregiao)
.then(data => this.regioes = data)
.catch(error => console.log('Something want wrong!'));
}
But I don’t know exactly how I do it, nor can I research exactly what I want. As I am still learning, I decided to ask for this information here :D
If anyone knows how to do this, or any tutorial, I really don’t know how to do it.
You already know how to get the bank information or you need it too ?
– Lucas Brogni
i already use the sqlite database.. I have segment Buttons in my code, and clicking on them I already get the database information. I only want now when selecting the region, search only the database information of that region. I have already created the table and columns in the database. I only need to use in select :D now
– Felipe XST
I posted as an answer.
– Lucas Brogni