json - 剑道 : Uncaught ReferenceError: uid is not defined

标签 json datagrid kendo-ui

在我的数据网格中,我使用 Tornado 服务器从转储为 json 的数据库中读取
如果访问了 api/notes,它看起来像这样:
{"total": 0, "rows": "[]"}
(表最初是空的,用户应该填写它......) 当然数据源是:

   transport: {
      read: {
        url: '/api/notes/',
        dataType: 'json',
        type: 'GET',
      },


      parameterMap: function(options, operation) {
        var map = {};
        if (operation == 'read') {
            map.page = options.page;
            map.rows = options.take;
            map.sort = options.sort;
            if (map.sort) {
              map.sort = map.sort[0];
              if (map.sort) {
                var t = map.sort;
                map.sort = t.field;
                map.order = t.dir;
              }
            }

在页面加载时,我收到 Uncaught ReferenceError: uid is not Defined

Chrome 转储:

Uncaught ReferenceError: uid is not defined
(anonymous function)
h.extend._rowsHtmlkendo.web.min.js:10
h.extend.refreshkendo.web.min.js:10
e.extend.proxy.gjquery.min.js:2
B.extend.triggerkendo.web.min.js:10
o.extend._processkendo.web.min.js:10
o.extend.successkendo.web.min.js:10
e.extend.proxy.gjquery.min.js:2
p.extend.read.c.successkendo.web.min.js:10
f.Callbacks.njquery.min.js:2
f.Callbacks.o.fireWithjquery.min.js:2
wjquery.min.js:4
f.support.ajax.f.ajaxTransport.send.djquery.min.js:4

最佳答案

尝试设置schema您的数据源:

schema: {
  total: "total",
  data: "rows"
}

关于json - 剑道 : Uncaught ReferenceError: uid is not defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14013158/

相关文章:

java - 我们如何在 Java 的 BDD 功能文件中将 JSON 对象列表作为 JSON 字符串传递

json - Shell 脚本空格转义

wpf - 使用 Prism WPF 在 Datagrid 中绑定(bind)命令

c# - 在 WPF 中安全访问 UI(主)线程

javascript - 如何在剑道组合框完成过滤器后触发事件

jquery - 使用 jquery 将简单的 json 发布到 MVC 操作 Controller 方法

c# - 如何在右键单击时获取数据网格列索引? MVVM WPF

kendo-ui - 剑道条形图x轴标签重叠

kendo-ui - Kendo Treeview 拖放总是父级的最后位置

java - 使用改造 2 在回收站 View 上显示项目