Here is a simple example I'm trying to build as an exercise and my DataSource object returns with no data.
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"
}
]
Any ideas?
There are two issues with your code
I can load load array to datasource and returns object, see
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)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.