Skip to content

Commit 09f24fd

Browse files
author
Igor Vaynberg
committed
add new options.type parameter for ajax helper. fixes select2#139
1 parent af964bd commit 09f24fd

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

select2.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,17 +250,18 @@
250250
requestSequence += 1; // increment the sequence
251251
var requestNumber = requestSequence, // this request's sequence number
252252
data = options.data, // ajax data function
253-
transport = options.transport || $.ajax;
254-
253+
transport = options.transport || $.ajax,
254+
type = options.type || 'GET'; // set type of request (GET or POST)
255+
255256
data = data.call(this, query.term, query.page, query.context);
256257

257-
if( null !== handler){
258-
handler.abort();
259-
}
258+
if( null !== handler) { handler.abort(); }
259+
260260
handler = transport.call(null, {
261261
url: options.url,
262262
dataType: options.dataType,
263263
data: data,
264+
type: type,
264265
success: function (data) {
265266
if (requestNumber < requestSequence) {
266267
return;

0 commit comments

Comments
 (0)