簡體   English   中英

Kendo ui:未捕獲的類型錯誤:無法讀取未定義的屬性“toLowerCase”

[英]Kendo ui: Uncaught TypeError: Cannot read property 'toLowerCase' of undefined

我正在使用 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誤,我應該使用TreeListDataSource而不是HierarchicalDataSource ,這是主要原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM