Skip to content

Commit 7c47912

Browse files
committed
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 select2#3548 This closes select2#3552
1 parent ef508db commit 7c47912

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/js/select2/data/ajax.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ define([
1818
AjaxAdapter.prototype._applyDefaults = function (options) {
1919
var defaults = {
2020
data: function (params) {
21-
return {
21+
return $.extend({}, params, {
2222
q: params.term
23-
};
23+
});
2424
},
2525
transport: function (params, success, failure) {
2626
var $request = $.ajax(params);

0 commit comments

Comments
 (0)