我对 kendoUI 和 json 很陌生,我的问题是数据似乎没有加载,可能是模式不正确或其他什么,没有错误,只是组合框一直在加载。这是我的示例代码:
$(document).ready(function () {
clientDS = new kendo.data.DataSource({
transport: {
read: {
url: "http://localhost/JSON_MP.asmx/GetListCountries?developerId=101&developerHash=9df7273b410761f74331bde746e5c2354b73b487×tamp=1242207092430", //Note the URL path!
dataType: "json",
contentType: "application/json; charset=utf-8"
}
},
schema: {
data: "listValues"
}
});
$("#kendoCboClient").kendoComboBox({
placeholder: "Select a Country...",
dataTextField: "name",
dataValueField: "id",
dataSource: clientDS
});
});
和我的数据堆栈:
{"errorString":"ok","errorCode":0,"listValues":[{"name":"UNKNOWN","id":1},{"name":"南非","id": 2},{"name":"莫桑比克","id":3},{"name":"菲律宾","id":4},{"name":"纳米比亚","id":5} ,{"name":"阿拉伯联合酋长国","id":6},{"name":"England","id":7},{"name":"Swaziland","id":8} ,{"name":"葡萄牙","id":9},{"name":"希腊","id":10},{"name":"毛里求斯","id":11},{ "name":"坦桑尼亚","id":12},{"name":"博茨瓦纳","id":13},{"名称":"西班牙","id":15},{"name":"苏格兰","id":16},{"name":"澳大利亚","id":17},{"name" :"新西兰","id":18},{"name":"塞浦路斯","id":19},{"name":"美国","id":20},{"name" :"德国","id":21},{"name":"","id":22},{"name":"马达加斯加","id":23},{"name":"马来西亚","id":24},{"name":"塞舌尔","id":25}],"listType":"Country"}"新西兰","id":18},{"name":"塞浦路斯","id":19},{"name":"美国","id":20},{"name": "德国","id":21},{"name":"","id":22},{"name":"马达加斯加","id":23},{"name":"马来西亚" ,"id":24},{"name":"塞舌尔","id":25}],"listType":"Country"}"新西兰","id":18},{"name":"塞浦路斯","id":19},{"name":"美国","id":20},{"name": "德国","id":21},{"name":"","id":22},{"name":"马达加斯加","id":23},{"name":"马来西亚" ,"id":24},{"name":"塞舌尔","id":25}],"listType":"Country"}id":24},{"name":"Seychelles","id":25}],"listType":"Country"}id":24},{"name":"Seychelles","id":25}],"listType":"Country"}
如果有人可以将我指向正确的方向或某事,请注意在数据堆栈中我使用“listValues”对象,可能是因为“”errorString“:”ok“,”errorCode“:0,”那是问题的一部分?