From 7c47912b730a5d1eb5e1213d6273e702e8aa0b9f Mon Sep 17 00:00:00 2001 From: Kevin Brown Date: Mon, 9 Nov 2015 18:49:40 -0500 Subject: [PATCH] Set all AJAX parameters as query string parameters This will now pass all of the AJAX parameters into the AJAX request as query string parameters, so now the page number (and other variables) will be set automatically. This can still be overridden in `ajax.data` to pass anything else, but this should make it easier for the most common case. This closes https://github.com/select2/select2/issues/3548 This closes https://github.com/select2/select2/pull/3552 --- src/js/select2/data/ajax.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/select2/data/ajax.js b/src/js/select2/data/ajax.js index 3ad4e4ec..c2cc8d6a 100644 --- a/src/js/select2/data/ajax.js +++ b/src/js/select2/data/ajax.js @@ -18,9 +18,9 @@ define([ AjaxAdapter.prototype._applyDefaults = function (options) { var defaults = { data: function (params) { - return { + return $.extend({}, params, { q: params.term - }; + }); }, transport: function (params, success, failure) { var $request = $.ajax(params);