raychenfj / ion-multi-picker

Multi Item Picker - An Ionic Custom Multi Picker Component
https://raychenfj.github.io/ion-multi-picker/
Other
236 stars 103 forks source link

I'd like have hooks or events fired when click cancel or done button #64

Closed maciej-w closed 7 years ago

maciej-w commented 7 years ago

How can I add hooks or events fired when press Done or Cancel Button?

raychenfj commented 7 years ago

Hi @maciej-w,

const cancel = { text: this.cancelText, role: 'multi-picker-cancel', handler: () => { this.ionCancel.emit(null); } }
const reset = { text: this.resetText, role: 'multi-picker-reset', handler: (data: any) => { this.reset(); return false; } }
const done = { text: this.doneText, handler: (data: any) => { this.onChange(data); this.ionChange.emit(data); } }

Check my code above, event ionCancel/ionChange will be emitted when you click cancel / done button, so you can add a listener to those two events