diff --git a/docs/_includes/options/data/ajax.html b/docs/_includes/options/data/ajax.html index d214b249..2f928463 100644 --- a/docs/_includes/options/data/ajax.html +++ b/docs/_includes/options/data/ajax.html @@ -19,7 +19,17 @@ What should the results returned to Select2 look like? - {% include options/not-written.html %} +

+ When you aren't using custom formatting functions (templateResult and templateSelection or formatResults) the data returned by the data provider or by processResults should be a list of objects. The objects should contain an id and a text property. The text property will be displayed. See What properties are required on the objects passed in to the array?. +

+ +{% highlight js linenos %} +[ + {id: 'id1', text: 'option1'}, + {id: 'id2', text: 'option2'}, + {id: 'id3', text: 'option3'}, +] +{% endhighlight %}

Is there a way to modify the response before passing it back to Select2?