剑道 UI 网格绑定错误
Kendo UI grid binding error
我正在使用剑道UI网格,这是我的代码
JAVASCRIPT
$("#logs").kendoGrid({
dataSource: {
type: "json",
transport: {
read: {
url: "https://localhost:1153/v3.svc/auditlog",
dataType: "json",
data: '?&tableName=' + table + '&userId=' + userId + '&fromDate=' + dateFrom + '&toDate=' + dateto + '&isSearchForClient=' + true,
type: "GET",
contentType: "application/json; charset=utf-8"
}
},
pageSize: 10, //page size
schema: {
data: "d", //root element that contains data array
total: "d.length" //total amount of records
}
},
pageable: true, //enable paging
columns: [{ field: "d.TransactionId", title: "TransactionID", width: "30px" }, { field: "d.Log", title: "Audit Logs", width: "110px" }]
});
来自服务器的内容是这样的
[ { "TransactionId" : "185492010250010630", "Log" : "Administrator Super has updated jobdescmanagement on 1/28/2015 4:24:03 PM"}]
它在控制台中的给出错误是
Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.
根据您的 JSON 数据结构字段配置应该是
columns: [{
field: "TransactionId",
title: "TransactionID",
width: "30px"
}, {
field: "Log",
title: "Audit Logs",
width: "110px"
}]
在这种情况下,不需要schema
配置,因为您没有根 JSON 元素。
架构
schema: {
data: "d"
}
表示数据具有以下格式:
{d: [{"TransactionId": "185492010250010630", "Log": "Administrator Super has updated jobdescmanagement on 1/28/2015 4:24:03 PM"}]}
但是,这不是您的情况。
相关文章:
- 绑定函数时在IE7中未实现Javascript错误
- jQuery结合了2个绑定函数(类型错误:a是未定义的)
- 异步面板绑定错误
- javascript onchange取消绑定错误|未定义
- Knockout绑定错误
- IE8中的Ember.js(1.0pre)属性绑定错误
- 反应更改绑定此错误
- 三.js - 没有纹理绑定到单元 0 错误
- 挖空 JS 样式绑定导致错误
- 将服务中的函数绑定到$scope(错误:无法设置undefined的属性'onChange')
- 未捕获的类型错误:对象#<对象>没有方法'绑定'-脊梁骨
- Knockout,无法解析空可观察数组中的绑定错误
- 检测Kendo UI值绑定错误
- 剑道 UI 网格绑定错误
- 通过 for 循环绑定会产生错误的结果
- DOM 绑定错误:未定义侦听器方法
- 挖空 无法解析绑定.引用错误
- 挖空视图模型绑定未定义错误
- 尝试运行节点 http 服务器时出现绑定错误
- 错误绑定引导日期时间选取器到模型角度