我有来自网络服务查询(_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();
我需要设置模型属性吗?因为我在使用“TNONAM”中的 dataTextValue 填充 DDL 之后。猜猜我混淆了“功能”和“属性”。