I am having trouble figuring out how to format my datasource for a sharepoint 2013 list using it's vanilla web service. I am simply trying to read, nothing else, but something just isn't clicking correctly. Here is what I have:
<script>
var listServiceURL = "http://devsite/_api/web/lists('<List GUID>')/items";
var datasource = new kendo.data.DataSource({
type: "odata",
transport: {
read: {
url: listServiceURL,
type: "GET",
dataType: "json",
contentType: "application/json;odata=verbose",
headers: {
"accept": "application/json;odata=verbose"
}
}
},
schema: {
data: "d.results",
model: {
id: "ID",
fields: {
ID: { editable: false, nullable: false },
Title: { validation: { required: true } },
}
}
},
pageSize: 20,
});
$(document).ready(function () {
$("[id$=companyGrid]").kendoGrid({
dataSource: datasource
});
});
</script>
<script>
var listServiceURL = "http://devsite/_api/web/lists('<List GUID>')/items";
var datasource = new kendo.data.DataSource({
type: "odata",
transport: {
read: {
url: listServiceURL,
type: "GET",
dataType: "json",
contentType: "application/json;odata=verbose",
headers: {
"accept": "application/json;odata=verbose"
}
}
},
schema: {
data: "d.results",
model: {
id: "ID",
fields: {
ID: { editable: false, nullable: false },
Title: { validation: { required: true } },
}
}
},
pageSize: 20,
});
$(document).ready(function () {
$("[id$=companyGrid]").kendoGrid({
dataSource: datasource
});
});
</script>