Picker handler
data return object with key set undefined
Not sure if this is a bug with the Picker or miss-used of the Picker component due to minimal documentation
numberPicker(){
let optionsHours = this.setRange();
this.pickerOptions.saveButton = {
text: 'Save',
handler: (data: any) => this.updateGoal(data)
}
this.pickerOptions.column = {
selectedIndex: this.weeklGoal,
options: optionsHours
}
}//numberPicker
setRange(){
let options = []
for (let i = 0; i <= 99; i++) {
options.push({
value: i,
text: i.toString()
})
}
return options
}
...
openPicker(){
if(!this.allowPicker) {
return false;
}
const picker = this.pickerController.create();
picker.addButton('Cancel');
picker.addButton(this.pickerOptions.saveButton);
picker.addColumn(this.pickerOptions.column);
picker.present();
}//setGoal
...
updateGoal(data: any){
// sample response https://monosnap.com/file/jdCfrJ3CADQMYsDiJyTKtlElCCpV7D
console.log(data)
}