Add cache property for select2 ajax options

This commit is contained in:
Roger Chen
2015-08-29 07:54:02 -07:00
parent 67605e10f6
commit 5c070aa2c2
2 changed files with 3 additions and 1 deletions

View File

@@ -56,6 +56,7 @@ $("#e6").select2({
ajax: {
url: "http://api.rottentomatoes.com/api/public/v1.0/movies.json",
dataType: 'jsonp',
cache: false,
data: function (term, page) {
return {
q: term,
@@ -195,4 +196,4 @@ $("#e8").select2("enable", false);
$("#e8").select2("readonly", false);
$("#e8").select2('container');
$("#e8").select2('onSortStart');
$("#e8").select2('onSortEnd');
$("#e8").select2('onSortEnd');

View File

@@ -26,6 +26,7 @@ interface Select2AjaxOptions {
url?: any;
dataType?: string;
quietMillis?: number;
cache?: boolean;
data?: (term: string, page: number, context: any) => any;
results?: (term: any, page: number, context: any) => any;
}