浏览代码

Added cache option for AJAX calls

Setting cache to 'false' sets the corresponding 'cache' setting in the jQuery.ajax call (as described here... http://api.jquery.com/jquery.ajax/ ).  

Setting the cache to 'false' is typically only useful for GET and HEAD methods (jQuery appends a timestamp to the URL to avoid browser caching of the resource) so I also added the default value as 'true' in BootstrapTable.DEFAULTS.  This is equivalent to what already existed in Bootstrap Table (so shouldn't affect anyone's existing scripts) as 'true' is the default for the cache setting in jQuery and does not append the timestamp to the URL.
thx2001r 11 年之前
父节点
当前提交
e58b26cc75
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      src/bootstrap-table.js

+ 2 - 0
src/bootstrap-table.js

@@ -100,6 +100,7 @@
         data: [],
         method: 'get',
         url: undefined,
+        cache: true,
         contentType: 'application/json',
         queryParams: function (params) {return {};},
         queryParamsType: undefined,
@@ -946,6 +947,7 @@
             type: this.options.method,
             url: this.options.url,
             data: data,
+            cache: this.options.cache,
             contentType: this.options.contentType,
             dataType: 'json',
             success: function (res) {