I trying to map a simple JSON data from the web service to the Kendo UI AutoComplete, but I keep on getting Unexpected token : error. Below is the data set from the service, and the Kendo UI piece.
{
"d": [{
"__type": "Subscriber:#Entities",
"ContactEmail": null,
"ContactName": null,
"ContactPhone": null,
"FolderPath": null,
"Notes": null,
"OrganizationName": "Sample Holdings PLC",
"ProvisionAckReceived": "\/Date(-62135571600000-0700)\/",
"ProvisionFileSent": "\/Date(-62135571600000-0700)\/",
"Status": null,
"SubscriberUpdated": "\/Date(-62135571600000-0700)\/"
}, {
"__type": "Subscriber:#Entities",
"ContactEmail": null,
"ContactName": null,
"ContactPhone": null,
"FolderPath": null,
"Notes": null,
"OrganizationName": "Sample LLC",
"ProvisionAckReceived": "\/Date(-62135571600000-0700)\/",
"ProvisionFileSent": "\/Date(-62135571600000-0700)\/",
"Status": null,
"SubscriberUpdated": "\/Date(-62135571600000-0700)\/"
}, {
"__type": "Subscriber:#Entities",
"ContactEmail": null,
"ContactName": null,
"ContactPhone": null,
"FolderPath": null,
"Notes": null,
"OrganizationName": "Test LLC",
"ProvisionAckReceived": "\/Date(-62135571600000-0700)\/",
"ProvisionFileSent": "\/Date(-62135571600000-0700)\/",
"Status": null,
"SubscriberUpdated": "\/Date(-62135571600000-0700)\/"
}]
}
<script>
$("#search").kendoAutoComplete({
dataTextField: "OrganizationName",
minLength: 3,
dataSource: {
type: "odata",
transport: {
read: GetServiceUrl('SubscriberSubscriptionSearch'),
parameterMap: function () {
return { searchText: $("#search").data("kendoAutoComplete").value() };
}
},
schema: {
data: "d",
model: {
fields: {
OrganizationName: { type: "string" }
}
}
}
},
placeholder: " Search existing Subscribers/Subscriptions",
close: onClose
});
</script>