I'm trying to connect to my local JSON file, but it's not working. I thought I'd start with the basics and copy the demo XML to a local file, but that's still not working. Just wondering if anyone can spot why it won't work locally? I'm using the basic grid setup code.
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "app/js/swagger-test.xml"
},
pageSize: 20
},
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "ContactName",
title: "Contact Name",
width: 200
}, {
field: "ContactTitle",
title: "Contact Title"
}, {
field: "CompanyName",
title: "Company Name"
}, {
field: "Country",
width: 150
}]
});
There are no errors showing, but neither is the data. If I change it to point to my JSON file and change the type to json, I get an undefined error.
Thanks for any help.
$("#grid").kendoGrid({
dataSource: {
type: "odata",
transport: {
read: "app/js/swagger-test.xml"
},
pageSize: 20
},
height: 550,
groupable: true,
sortable: true,
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "ContactName",
title: "Contact Name",
width: 200
}, {
field: "ContactTitle",
title: "Contact Title"
}, {
field: "CompanyName",
title: "Company Name"
}, {
field: "Country",
width: 150
}]
});
There are no errors showing, but neither is the data. If I change it to point to my JSON file and change the type to json, I get an undefined error.
Thanks for any help.