Skip to content

Commit

Permalink
Allow chosen field to be called within a form collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Schyzophrenic committed Mar 19, 2012
1 parent 4d2aea9 commit 4e25909
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Resources/doc/jquery/chosen/index.md
Expand Up @@ -18,6 +18,20 @@ public function buildForm(FormBuilder $builder, array $options)
}
```

## Add in your view, after calling the jQuery library
``` twig
<script src="{{ asset('bundles/genemuform/js/genemuFormBundle.js') }}"></script>
{{ form_javascript(form) }}
```

## Usage in Form Collection
When the chosen field is created within a collection, only the configuration is setup in the data-prototype.
In that case, you need to manually trigger the chosen function via a call to

``` javascript
genemuFormBundleChosenEnable(chosenFieldId);
```

## Extra

1. [Choices](https://github.com/genemu/GenemuFormBundle/blob/2.0/Resources/doc/jquery/chosen/choices.md)
Expand Down

0 comments on commit 4e25909

Please sign in to comment.