Skip to content

Commit

Permalink
Merge pull request #662 from yourlabs/select2_options
Browse files Browse the repository at this point in the history
Examples for Select2 options in tutorial [ci skip]
  • Loading branch information
jpic committed Mar 26, 2016
2 parents 33ef205 + 0f18b86 commit c3a2a68
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/tutorial.rst
Expand Up @@ -161,6 +161,28 @@ widget, ie.:
'visited_countries': autocomplete.ModelSelect2Multiple(url='country-autocomplete')
}
Passing options to select2
==========================

`Select2
<https://select2.github.io/>`_ supports a bunch of `options
<https://select2.github.io/options.html>`_. These options may be
`set in data-* attributes
<https://select2.github.io/options.html#data-attributes>`_. For example:

.. code-block:: python
# Instanciate a widget with a bunch of options for select2:
autocomplete.ModelSelect2(
url='select2_fk',
attrs={
# Set some placeholder
'data-placeholder': 'Autocomplete ...',
# Only trigger autocompletion after 3 characters have been typed
'data-minimum-input-length': 3,
},
)
Using autocompletes in the admin
================================

Expand Down

0 comments on commit c3a2a68

Please sign in to comment.