[英]Simple Kendo UI remote DataSource returns empty
这是一个简单的例子,我正在尝试构建一个练习,我的DataSource对象返回时没有数据。
var data = new kendo.data.DataSource({
transport: {
read: {
url: "data.json",
dataType: "json"
}
}
});
console.dir( data );
data.json
[
{
"text": "Brand One"
},
{
"text": "Brand Two"
},
{
"text": "Brand Three"
},
{
"text": "Brand Four"
}
]
有任何想法吗?
您的代码有两个问题
我可以将load数组加载到datasource并返回对象,参见
var data_input= [
{
"text": "Brand One"
},
{
"text": "Brand Two"
},
{
"text": "Brand Three"
},
{
"text": "Brand Four"
}
];
var data = new kendo.data.DataSource({
transport: {
read: {
data: data_input,
dataType: "json"
}
}
});
console.log(data)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.