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.29k stars 371 forks source link

Fire event after alpaca is loaded #727

Open noith opened 4 years ago

noith commented 4 years ago

Hello. I'm using alpaca to generate forms from php and it is not good at all to mix php and js code. Read docs and couldn't find, if there is any event like .loaded() or rendered() in alpaca, to which i can attach handlers? May be it would be cool to make one?

martingaleh commented 4 years ago

postRender maybe: http://www.alpacajs.org/docs/api/observables.html

noith commented 4 years ago

Sure it works, and i know about that, but wanted smth like

$('#form').alpaca('get').postRender(function(){ code here})

The point is that i generate json from php and dont want to mix js and php code