From 31cc5ed40a731a0871ed688934fedb92f2779a9c Mon Sep 17 00:00:00 2001 From: sambomartin Date: Mon, 13 Aug 2012 19:57:50 +0200 Subject: [PATCH] Update select2.js Added 'traditional' ajax parameter --- select2.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/select2.js b/select2.js index 8fd0c499..57345e76 100755 --- a/select2.js +++ b/select2.js @@ -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;