Skip to content

Commit a20dba0

Browse files
authored
Update README.md
1 parent b55a5f4 commit a20dba0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ If text_property is omitted then the entity is cast to a string. This requires i
132132
* `delay` The delay in milliseconds after a keystroke before trigging another AJAX request. Defaults to 250 ms.
133133
* `placeholder` Placeholder text.
134134
* `language` i18n language code. Defaults to en.
135+
* `theme` Defaults to 'default'.
135136
* `cache` Enable AJAX cache. Results will be cached for each 'term' queried.
136137
* `cache_timeout` How long to cache a query in milliseconds. Setting to `0` will cause the cache to never timeout _(60000 = 60 seconds)_
137138
* `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:
155156
allow_clear: true
156157
delay: 500
157158
language: 'fr'
159+
theme: 'default'
158160
cache: false
159161
cache_timeout: 0
160162
scroll: true
@@ -408,6 +410,10 @@ You also will need to override the following block in your template:
408410
```
409411
This block adds all additional data needed to the JavaScript function `select2entityAjax`, like data attribute. In this case we are passing `data-img`.</details>
410412

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+
411417
## Embed Collection Forms
412418
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`:
413419
```javascript

0 commit comments

Comments
 (0)