genemu/GenemuFormBundle

Multiple select2 inputs with ajax

Closed this issue · 2 comments

jxn commented

From what I can tell in the example (https://github.com/genemu/GenemuFormBundle/blob/master/Resources/doc/jquery/select2/ajax.md) it is not possible to have multiple select2 inputs using ajax querying separate resources on the same form, because overriding the genemu_jqueryselect2_javascript block in the view will override it for all select2 widgets.

Would it be possible to specify the query or ajax data resource in the configs parameter, or some other option?

jxn commented

Wow, I don't know what I was thinking when I filed this issue. This is already possible, just by adding the resource to the 'configs' array() in the form builder. I just did it while starting to think about how I would implement it for a pull request. Nevermind!

Would you mind showing a little bit of code with your explanation please. I know there is a couple of us having the same problem. Would be greatly appreciated.