试图找出剑道世界,并将网格设置为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) 我从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之后.猜猜我混淆了"功能"和"属性".