@@ -87,6 +87,21 @@ <h1>Placeholders</h1>
8787 < select class ="js-example-placeholder-multiple js-states form-control " multiple ="multiple "> </ select >
8888 </ p >
8989 </ div >
90+ < div class ="col-md-8 ">
91+ < h2 > Example code</ h2 >
92+
93+ < pre data-fill-from =".js-code-placeholder "> </ pre >
94+
95+ < script type ="text/x-example-code " class ="js-code-placeholder ">
96+ $ ( ".js-example-placeholder-single" ) . select2 ( {
97+ placeholder : "Select a state"
98+ } ) ;
99+
100+ $ ( ".js-example-placeholder-multiple" ) . select2 ( {
101+ placeholder : "Select a state"
102+ } ) ;
103+ </ script >
104+ </ div >
90105 </ section >
91106
92107 < seection id ="data-array " class ="row ">
@@ -138,22 +153,29 @@ <h2>Example code</h2>
138153 </ div >
139154 </ section >
140155
141- < section id ="data-ajax ">
142- < h1 > Loading remote data</ h1 >
156+ < section id ="data-ajax row ">
157+ < div class ="col-md-12 ">
158+ < h1 > Loading remote data</ h1 >
143159
144- < p >
145- Select2 comes with AJAX support built in, using jQuery's AJAX methods.
146- </ p >
160+ < p >
161+ Select2 comes with AJAX support built in, using jQuery's AJAX methods.
162+ </ p >
163+
164+ < p >
165+ < select class ="js-example-data-ajax form-control "> </ select >
166+ </ p >
147167
148- < p >
149- < select class ="js-example-data-ajax form-control "> </ select >
150- </ p >
168+ < pre data-fill-from =".js-code-data-ajax "> </ pre >
151169
152- < pre data-fill-from =".js-code-data-ajax "> </ pre >
170+ < p >
171+ Select2 will pass any options in the < code > ajax</ code > object to
172+ jQuery's < code > $.ajax</ code > function.
173+ </ p >
153174
154175< script type ="text/x-example-code " class ="js-code-data-ajax ">
155176
156177</ script >
178+ </ div >
157179 </ section >
158180</ div >
159181
0 commit comments