小编rip*_*sin的帖子

KendoGrid JavaScript运行时错误:模板无效

试图找出剑道世界,并将网格设置为json数组数据源.

Error is "JavaScript runtime error: Invalid template: <tr
data-uid="#=data.uid#" role='row'><td  role='gridcell'>#=data.Account
Num==null?'':data.Account Num#</td>...".
Run Code Online (Sandbox Code Playgroud)

我注意到在这个错误中我看到空值,想知道这是否意味着数据没有绑定?

我看到列标题,但不是任何行.我还必须提一下,我的数据中没有任何ID字段,因为我正在使用SQL视图中的临时表.

function populateGrid(search) {
    $("#grdAttributes").kendoGrid({
        dataSource: {
            transport: {
                read: {
                    url: "http://127.0.0.2:6080/arcgis/rest/services/WW/WW2/MapServer/exts/RestSOE/Search%20Query?columnName=" + search.columnName + "&operand=" + search.operand + "&searchVal=" + search.searchVal + "&f=",
                    dataType: "json",
                    type: 'GET'
                }
            },
        },
        serverPaging: true,
        serverSorting: true,
        serverFiltering: true,
        scrollable: true,
        height: 150

    });
    $("#grdAttributes").data().kendoGrid.dataSource.view()
};
Run Code Online (Sandbox Code Playgroud)

如果我继续VS2012中的错误,我会看到网格中的列标题.只是没有行数据.(示例JSON下面:)

 -[{
     -"Address": "PO BOX 20",
     -"City": "HAVENWOOD",
     -"Location": "",
     -"Name 1": "UNIVERSITY",
     -"Name 2": "",
     -"Street": "NEY AVE",
     -"Street …
Run Code Online (Sandbox Code Playgroud)

javascript sql json kendo-ui kendo-grid

5
推荐指数
1
解决办法
5240
查看次数

正确绑定json与Kendo DropDownList

我从webservice查询(_urlTowns)获得以下json数据(见下文).我想将一个Kendo UI下拉列表控件绑定到此datasourceTowns.

{
"displayFieldName": "TNONAM",
"fieldAliases": {
    "TNONAM": "TNONAM"
},
"fields": [{
    "name": "TNONAM",
    "type": "esriFieldTypeString",
    "alias": "TNONAM",
    "length": 16
}],
"features": [{
    "attributes": {
        "TNONAM": "ANSONIA"
    }
}, {
    "attributes": {
        "TNONAM": "BETHANY"
    }
}, {
    "attributes": {
        "TNONAM": "BRANFORD"
    }
}, {
    "attributes": {
        "TNONAM": "WOODBRIDGE"
    }
}]}
// Towns data source
var dataSourceTowns = new kendo.data.DataSource({
transport: {
    read: {
        url: _urlTowns,
        dataType: "json",
        type: 'GET'
    }
},
schema: {
    data: "features"
}});dataSourceTowns.read();
Run Code Online (Sandbox Code Playgroud)

我需要设置模型属性吗?正在我用"TNONAM"中的dataTextValue填充DDL之后.猜猜我混淆了"功能"和"属性".

javascript json jsonp kendo-ui

1
推荐指数
1
解决办法
9689
查看次数

标签 统计

javascript ×2

json ×2

kendo-ui ×2

jsonp ×1

kendo-grid ×1

sql ×1