You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,6 +132,7 @@ If text_property is omitted then the entity is cast to a string. This requires i
132
132
*`delay` The delay in milliseconds after a keystroke before trigging another AJAX request. Defaults to 250 ms.
133
133
*`placeholder` Placeholder text.
134
134
*`language` i18n language code. Defaults to en.
135
+
*`theme` Defaults to 'default'.
135
136
*`cache` Enable AJAX cache. Results will be cached for each 'term' queried.
136
137
*`cache_timeout` How long to cache a query in milliseconds. Setting to `0` will cause the cache to never timeout _(60000 = 60 seconds)_
137
138
*`transformer` The fully qualified class name of a custom transformer if you need that flexibility as described below.
@@ -155,6 +156,7 @@ tetranz_select2_entity:
155
156
allow_clear: true
156
157
delay: 500
157
158
language: 'fr'
159
+
theme: 'default'
158
160
cache: false
159
161
cache_timeout: 0
160
162
scroll: true
@@ -408,6 +410,10 @@ You also will need to override the following block in your template:
408
410
```
409
411
This block adds all additional data needed to the JavaScript function `select2entityAjax`, like data attribute. In this case we are passing `data-img`.</details>
410
412
413
+
### Themes
414
+
Select2 supports custom themes using the `theme` option so you can style Select2 to match the rest of your application.
415
+
For Bootstrap4 theme look at https://github.com/ttskch/select2-bootstrap4-theme
416
+
411
417
## Embed Collection Forms
412
418
If you use [Embedded Collection Forms](http://symfony.com/doc/current/cookbook/form/form_collections.html) and [data-prototype](http://symfony.com/doc/current/cookbook/form/form_collections.html#allowing-new-tags-with-the-prototype) to add new elements in your form, you will need the following JavaScript that will listen for adding an element `.select2entity`:
0 commit comments