【问题标题】:Kendo ui: Uncaught TypeError: Cannot read property 'toLowerCase' of undefinedKendo ui:未捕获的 TypeError:无法读取未定义的属性“toLowerCase”
【发布时间】:2016-03-24 03:23:29
【问题描述】:

我正在使用 kendo ui 树列表组件,并从远程源获取数据。数据源定义为:

$("#location-manage-grid").kendoTreeList({
    dataSource: new kendo.data.HierarchicalDataSource({
        transport: {
            read: {
                url: "api/getLocation",
                dataType: "json"
            }
        },
        schema: {
            model: {
                id: "id",
                location: "location",
                hierarchy: "hierarchy",
                hasChildren: "hasChildren",
                map: "map"
            }
        }
    }),
    height: 600,
    pageable: true,
    columns: [
        { field: "hierarchy", title: "Hierarchy", width: 250 },
        { field: "location", title: "location", width: 250 },
        { field: "map", title: "map", width: 250 },
        { title: "Edit", command: [ "edit", "destroy" ], width: 250,  attributes: { style: "text-align: center;" } }
    ]
});

数据源url的响应是

[{"hasChildren":true,"hierarchy":"Kendo ui","location":"New York","id":1,"map":true}]

但是,当我运行应用程序时,它有一个错误,它说:

未捕获的类型错误:无法读取未定义的属性“toLowerCase”

我检查了架构定义,我真的找不到哪里出错了。有谁知道为什么?

【问题讨论】:

  • 和你这里贴的不一样,我发现自己犯了什么错误。
  • 告诉我们。原因是什么?
  • 我应该使用TreeListDataSource 而不是HierarchicalDataSource,这是主要原因。
  • 感谢分享

标签: javascript jquery kendo-ui kendo-treelist


【解决方案1】:

我发现我犯了什么错误,我应该使用TreeListDataSource而不是HierarchicalDataSource,这是主要原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-06
    相关资源
    最近更新 更多