gitana / alpaca

Alpaca provides the easiest way to generate interactive HTML5 forms for web and mobile applications. It uses JSON Schema and simple Handlebars templates to generate great looking, dynamic user interfaces on top of Twitter Bootstrap, jQuery UI, jQuery Mobile and HTML5.
http://www.alpacajs.org
Other
1.3k stars 368 forks source link

Select2 Ajax #687

Open marcosn41 opened 5 years ago

marcosn41 commented 5 years ago

Hi, i used Select2 call on postRender, and works fine. So i tried to make work with ajaxcall. The field work with the search, but when i click on a result, show me this error:

alpaca.min.js:1 Uncaught TypeError: Cannot read property 'value' of undefined

I think after change alpaca try to read the new value, and this value dont exist on enum. Somebody could help me with this?

marcosn41 commented 5 years ago

Ok, i found a not-friendly solution... but will help if anyone need this. On postRender i inserted another select using $.after and applied select2 to this field and hidden the select alpaca field. For me work ok. But i loose the alpaca validation, so you'll need make your own validation to this field.