1
0
mirror of synced 2025-02-09 16:49:24 +03:00

Update select2.js

Added 'traditional' ajax parameter
This commit is contained in:
sambomartin 2012-08-13 19:57:50 +02:00
parent af6a3f556a
commit 31cc5ed40a

View File

@ -277,6 +277,7 @@
* @param options.url url for the data
* @param options.data a function(searchTerm, pageNumber, context) that should return an object containing query string parameters for the above url.
* @param options.dataType request data type: ajax, jsonp, other datatatypes supported by jQuery's $.ajax function or the transport function if specified
* @param options.traditional a boolean flag that should be true if you wish to use the traditional style of param serialization for the ajax request
* @param options.quietMillis (optional) milliseconds to wait before making the ajaxRequest, helps debounce the ajax function if invoked too often
* @param options.results a function(remoteData, pageNumber) that converts data returned form the remote request to the format expected by Select2.
* The expected format is an object containing the following keys:
@ -297,6 +298,7 @@
var requestNumber = requestSequence, // this request's sequence number
data = options.data, // ajax data function
transport = options.transport || $.ajax,
traditional = options.traditional || false,
type = options.type || 'GET'; // set type of request (GET or POST)
data = data.call(this, query.term, query.page, query.context);
@ -308,6 +310,7 @@
dataType: options.dataType,
data: data,
type: type,
traditional: traditional,
success: function (data) {
if (requestNumber < requestSequence) {
return;