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

Request add more buttons with handle #41

Closed hbt272 closed 7 years ago

hbt272 commented 7 years ago

Hi, I would like this component has an option about add custom button with custom handle data picked like this: <ion-multi-picker id="simple" item-content [multiPickerColumns]="columns" [(ngModel)]="data" selectOptions="options"></ion-multi-picker> And the options has this structor: options = { buttons: [ { text: 'button1', handler: () => { console.log('do some thing');} }, { text: 'buttob2', handler: (data) => { console.log('data');} } ] }

I see in your code have pickerOptions.buttons in the open() funtion. I think you can append more button here! Hope this feature success! Thanks.

raychenfj commented 7 years ago

@hbt272

Thanks for feedback, will take a look 🙃

raychenfj commented 7 years ago

@hbt272

Yes, technically this is possible. But just out of curious, may I ask your use case for this request ?

mdopieralski commented 7 years ago

Hi @raychenfj, it may be useful to create some kind of "Clear" button for example, which will allow to set default value. That's my use case, which actually conducted me to this plugin and issue :-)

PS. Thanks for your amazing job with this plugin !

bnfrnz commented 7 years ago

Hi @raychenfj - First, thanks much for this! I'd like to +1 the "Clear" button idea. Our use case also demands being able to reset the picker values to null. And I would imagine this to be quite a common case. Thanks for considering...

+Being able to easily programmatically change the button labels would also be great for i18n & l10n...

plaidfox commented 7 years ago

@raychenfj This plugin is awesome. I agree with bnfrnz and mdopieralski. I'd love to have a quick clear button for users to reset their multi-picker.

Thanks!

raychenfj commented 7 years ago

Accepted, will try to add a clear/reset buttton in my coming weekend.

Thanks.

raychenfj commented 7 years ago

This feature is released in version 2.1.1, thanks.