I have a URL link to a single packet non-array JSONP data. I am having trouble configuring the Kendo DataSource to read it correctly. I know it has something to do with the schema, but I am not finding a lot of documentation on the configuration parameters. My JSON data looks like this:
I have verified that the JSON data is valid using JSONLint. I have created a simple test HTML file to read this data from the service which looks like this:
<!DOCTYPE html>
<html>
<head>
<title>datasource test</title>
<script src="../../../js/jquery.min.js"></script>
<script src="../../../js/kendo.data.min.js"></script>
<script src="../../../js/kendo.dataviz.min.js"></script>
</head>
<body>
<div id="example">
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
//url: "http://search.twitter.com/search.json?q=HTML5",
url: "http://localhost:8080/APEI_Snap/APEI_Data_Snapshot/1",
dataType: "jsonp",
type: "GET"
}
},
schema: {
data: "results"
},
change: function() {
var view = this.view();
alert(kendo.stringify(view[0])); //I know view[0] is wrong since I don't have an array....
}
});
dataSource.read();
</script>
</div>
</body>
</html>
I need to be able to pulls out the individual data points, which I will eventually bind to the dataviz objects. Can someone help me figure out how to setup the datasource? Thanks for any help you can provide.
Mark
{"results":{"data1":0.928287,"data2":0.966691,"data3":0.897367,"adataA":0.329710,"adataB":0.818630,"adataC":0.667666,"adataIA":0.983468,"adataIB":0.726931,"adataIC":0.848747,"active":0.616980,"active1":0.616980,"factor":0.553658,"efficiency":1.454451,"system":true,"alarm":true,"connect":false,"state":21.815668,"online":true},"timeoday":"5/4/20127:50 AM"}
I have verified that the JSON data is valid using JSONLint. I have created a simple test HTML file to read this data from the service which looks like this:
<!DOCTYPE html>
<html>
<head>
<title>datasource test</title>
<script src="../../../js/jquery.min.js"></script>
<script src="../../../js/kendo.data.min.js"></script>
<script src="../../../js/kendo.dataviz.min.js"></script>
</head>
<body>
<div id="example">
<script>
var dataSource = new kendo.data.DataSource({
transport: {
read: {
//url: "http://search.twitter.com/search.json?q=HTML5",
url: "http://localhost:8080/APEI_Snap/APEI_Data_Snapshot/1",
dataType: "jsonp",
type: "GET"
}
},
schema: {
data: "results"
},
change: function() {
var view = this.view();
alert(kendo.stringify(view[0])); //I know view[0] is wrong since I don't have an array....
}
});
dataSource.read();
</script>
</div>
</body>
</html>
I need to be able to pulls out the individual data points, which I will eventually bind to the dataviz objects. Can someone help me figure out how to setup the datasource? Thanks for any help you can provide.
Mark