I am reading a JSON file as a dataSource (example below), and binding that data to a ListView.
===== dataSource definition =====
var data = new kendo.data.DataSource({
transport: {
read: {
url: "json/data.json",
dataType: "json"
}
}
});
===== contents of data.json ===
[
{"id": "111", "location" : "Location A"},
{"id": "222", "location" : "Location B"}
.....
]
I would like to come back later and reference one of the elements in that datasource such as data[0].id, or data[0].location.
How do I go about exposing the data?
===== dataSource definition =====
var data = new kendo.data.DataSource({
transport: {
read: {
url: "json/data.json",
dataType: "json"
}
}
});
===== contents of data.json ===
[
{"id": "111", "location" : "Location A"},
{"id": "222", "location" : "Location B"}
.....
]
How do I go about exposing the data?