Kendo 远程数据源和参数
Kendo remote datasource and parameters
我正在尝试调用读取方法,但同时也传入了参数。下面是我的代码,我可以看到正在传递值,但控制台中出现错误:
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: URL + "/Read?StudentNum=" + studentNum + "AndStudentDept=" + studentDept,
dataType: "json",
data: {
studentNum: studentNum,
studentDept: studentDept
}
},
pageSize: 5,
schema: {
data: function (response) {
console.log(response);
return response.Data.dsstudentReport.ttstudentReport;
},
}
}
});
The error is: kendo.all.js:7165 Uncaught TypeError: e.slice is not a function
I will continue to keep looking but if anyone could help me identify where I have made a mistake, that would be greatly appreciated. I am new to Kendo and still learning.
Thanks
经常出现这个错误是因为schema
中没有model
。尝试添加它。
例如:
transport: {},
schema: {
model: {
id: "id",
fields: {
name: { type: "string" },
isActive: { type: "boolean" },
age: { type: "number" }
}
}
}
它表示您正在使用 read
方法获取的数据结构。
Ps。 schema
必须与 transport
处于同一级别。在你的情况下 schema
在 transport
里面
我正在尝试调用读取方法,但同时也传入了参数。下面是我的代码,我可以看到正在传递值,但控制台中出现错误:
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: URL + "/Read?StudentNum=" + studentNum + "AndStudentDept=" + studentDept,
dataType: "json",
data: {
studentNum: studentNum,
studentDept: studentDept
}
},
pageSize: 5,
schema: {
data: function (response) {
console.log(response);
return response.Data.dsstudentReport.ttstudentReport;
},
}
}
});
The error is: kendo.all.js:7165 Uncaught TypeError: e.slice is not a function
I will continue to keep looking but if anyone could help me identify where I have made a mistake, that would be greatly appreciated. I am new to Kendo and still learning.
Thanks
经常出现这个错误是因为schema
中没有model
。尝试添加它。
例如:
transport: {},
schema: {
model: {
id: "id",
fields: {
name: { type: "string" },
isActive: { type: "boolean" },
age: { type: "number" }
}
}
}
它表示您正在使用 read
方法获取的数据结构。
Ps。 schema
必须与 transport
处于同一级别。在你的情况下 schema
在 transport