Browse Source

Fix #193: Add dataType option.

zhixin 11 years ago
parent
commit
de4e4764ad
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/bootstrap-table.js

+ 2 - 1
src/bootstrap-table.js

@@ -125,6 +125,7 @@
         url: undefined,
         url: undefined,
         cache: true,
         cache: true,
         contentType: 'application/json',
         contentType: 'application/json',
+        dataType: 'json',
         queryParams: function (params) {return params;},
         queryParams: function (params) {return params;},
         queryParamsType: 'limit', // undefined
         queryParamsType: 'limit', // undefined
         responseHandler: function (res) {return res;},
         responseHandler: function (res) {return res;},
@@ -1108,7 +1109,7 @@
             data: data,
             data: data,
             cache: this.options.cache,
             cache: this.options.cache,
             contentType: this.options.contentType,
             contentType: this.options.contentType,
-            dataType: 'json',
+            dataType: this.options.dataType,
             success: function (res) {
             success: function (res) {
                 res = calculateObjectValue(that.options, that.options.responseHandler, [res], res);
                 res = calculateObjectValue(that.options, that.options.responseHandler, [res], res);