Kendo UI DataSource 在 ajax 调用 "this.substr is not a function" 时中断
Kendo UI DataSource is breaking on ajax call "this.substr is not a function"
我遇到错误:
Uncaught TypeError: this.substr is not a function
String.remove @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:25867
e @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3465
ci @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:249
i.param @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3475
ajax @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3668
read @ kendo.all.min.js:11
(anonymous function) @ kendo.all.min.js:11
_queueRequest @ kendo.all.min.js:11
read @ kendo.all.min.j
我知道这不是很有帮助。这是传输对象的样子:
var dataSource = {
transport: {
read: {
type: 'POST',
url: ajaxUrlFn(), //returns string
dataType: 'application/json; charset=UTF-8',
data: self.searchJson(), //returns string
},
schema: {
data: function (response) {
//code stuff...
},
},
},
};
这将击中 read
物体然后断裂。
似乎 transport.read.data
属性 需要对象类型而不是字符串类型。
var dataSource = {
transport: {
read: {
type: 'POST',
url: ajaxUrlFn(), //returns string
dataType: 'application/json; charset=UTF-8',
----------->data: self.searchObject() //returns an object <-----------
},
schema: {
data: function (response) {
//code stuff...
},
},
},
};
我遇到错误:
Uncaught TypeError: this.substr is not a function
String.remove @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:25867
e @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3465
ci @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:249
i.param @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3475
ajax @ vendor?v=aDfyqYhlmP6LIh14D-zVAUS28dc7bUxpraoGG0oruGc1:formatted:3668
read @ kendo.all.min.js:11
(anonymous function) @ kendo.all.min.js:11
_queueRequest @ kendo.all.min.js:11
read @ kendo.all.min.j
我知道这不是很有帮助。这是传输对象的样子:
var dataSource = {
transport: {
read: {
type: 'POST',
url: ajaxUrlFn(), //returns string
dataType: 'application/json; charset=UTF-8',
data: self.searchJson(), //returns string
},
schema: {
data: function (response) {
//code stuff...
},
},
},
};
这将击中 read
物体然后断裂。
似乎 transport.read.data
属性 需要对象类型而不是字符串类型。
var dataSource = {
transport: {
read: {
type: 'POST',
url: ajaxUrlFn(), //returns string
dataType: 'application/json; charset=UTF-8',
----------->data: self.searchObject() //returns an object <-----------
},
schema: {
data: function (response) {
//code stuff...
},
},
},
};