1
0
mirror of synced 2024-11-26 14:56:07 +03:00

fixed up docs, closes #31

This commit is contained in:
Igor Vaynberg 2012-04-13 11:30:13 -07:00
parent ac5b10779e
commit 671635449d
2 changed files with 6 additions and 6 deletions

View File

@ -129,12 +129,12 @@ $("#e6").select2({
dataType: 'jsonp', dataType: 'jsonp',
data: function (term, page) { data: function (term, page) {
return { return {
q: term, q: term, // search term
page_limit: 10, page_limit: 10,
apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working
}; };
}, },
results: function (data, vars) { // parse the results into the format expected by Select2. results: function (data, page) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data // since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data.movies}; return {results: data.movies};
} }
@ -156,7 +156,7 @@ $("#e7").select2({
quietMillis: 100, quietMillis: 100,
data: function (term, page) { // page is the one-based page number tracked by Select2 data: function (term, page) { // page is the one-based page number tracked by Select2
return { return {
q: term, q: term, //search term
page_limit: 10, // page size page_limit: 10, // page size
page: page, // page number page: page, // page number
apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working apikey: "ju6z9mjyajq2djue3gbvv26t" // please do not use so this example keeps working
@ -876,10 +876,10 @@ $("#tags").select2({
</td></tr> </td></tr>
<tr><td>results</td><td>function</td><td> <tr><td>results</td><td>function</td><td>
Function used to build the query results object from the ajax response Function used to build the query results object from the ajax response
<pre>results(term, page)</pre> <pre>results(data, page)</pre>
<table class="table table-bordered table-striped"> <table class="table table-bordered table-striped">
<tr><th>Parameter</th><th>Type</th><th>Description</th></tr> <tr><th>Parameter</th><th>Type</th><th>Description</th></tr>
<tr><td>term</td><td>string</td><td>Search term</td></tr> <tr><td>data</td><td>object</td><td>Retrieved data</td></tr>
<tr><td>page</td><td>int</td><td>Page number that was passed into the <code>data</code> function above</td></tr> <tr><td>page</td><td>int</td><td>Page number that was passed into the <code>data</code> function above</td></tr>
<tr><td>&lt;returns&gt;</td><td>object</td><td>Results object. See &quot;options.callback&quot; in the &quot;query&quot; function for format.</td></tr> <tr><td>&lt;returns&gt;</td><td>object</td><td>Results object. See &quot;options.callback&quot; in the &quot;query&quot; function for format.</td></tr>
</table> </table>

@ -1 +1 @@
Subproject commit 120aff9582f58d461675daadabea00fe9935ea54 Subproject commit 7bd7139563892e7478de2e334ed15881967feed0