kartik-v / yii2-widget-select2

Enhanced Yii2 wrapper for the Select2 jQuery plugin (sub repo split from yii2-widgets).
http://demos.krajee.com/widget-details/select2
Other
323 stars 145 forks source link

Select if exists, create if not #227

Closed Benn closed 7 years ago

Benn commented 7 years ago

Hi Kartik, I'm wondering if it would be easy/possible to add a feature to the widget which would allow the user to add a custom value to the select. For example, if the form is used to select a car model from a database table, to allow the user to add one that is non existant in the database. Thanks in advance.

Cheers

Benn

kartik-v commented 7 years ago

You may want to go through the docs. You would need to use the tagging feature. Its demonstrated in the documentation here and ability to add one's own tags.

You need to design your application form and inputs accordingly and write the server code to populate these additional values into the database.

Benn commented 7 years ago

Thanks for taking the time to reply to what turned out to be a stupid question.

Cheers

Benn

2017-09-16 8:13 GMT+02:00 Kartik Visweswaran notifications@github.com:

You may want to go through the docs. You would need to use the tagging feature. Its demonstrated in the documentation here and ability to add one's own tags http://demos.krajee.com/widget-details/select2#usage-tags .

You need to code your application form and write the server code to populate these additional values into the database.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kartik-v/yii2-widget-select2/issues/227#issuecomment-329948987, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQnsay1umzxJR2zZqYfeYcj9ND-_T_mks5si2chgaJpZM4PZlz- .