Browse Source

query as third parameter to ajax results callback

for e.g. proper cache implementation it is necessary to have the complete query in the results callback of the ajax function. to not break backwards compatibility i added it as third parameter and did not replace query.page parameter
thereloaded 11 years ago
parent
commit
f07bab5a6b
1 changed files with 2 additions and 1 deletions
  1. 2 1
      select2.js

+ 2 - 1
select2.js

@@ -438,7 +438,8 @@ the specific language governing permissions and limitations under the Apache Lic
                     data: data,
                     data: data,
                     success: function (data) {
                     success: function (data) {
                         // TODO - replace query.page with query so users have access to term, page, etc.
                         // TODO - replace query.page with query so users have access to term, page, etc.
-                        var results = options.results(data, query.page);
+                        // added query as third paramter to keep backwards compatibility
+                        var results = options.results(data, query.page, query);
                         query.callback(results);
                         query.callback(results);
                     }
                     }
                 });
                 });