I have the following kendo grid:
$("#grid").kendoGrid({
dataSource: {
transport: {
url: "customers",
type: "GET",
dataType: "json"
}
},
height: 550,
columns: [{
field: "contactName",
title: "Contact Name",
width: 240
}, {
field: "contactTitle",
title: "Contact Title"
}, {
field: "companyName",
title: "Company Name"
}, {
field: "country",
width: 150
}]
});
The JSON response from the server looks like:
{
"date": "2020-02-02",
"responseType": "customer contact",
"customerContact": [{
"contactName": "Bob Smith",
"contactTitle": "Manager",
"companyName": "Acme",
"country": "Canada"
},{
//more customerContact data
}]
}
The grid is trying to populate using this full JSON object. How can I tell it to use only the customerContact property within the object?
I also need to get the date and responseType from the response to populate an HTML element outside the grid using:
$("#title").append('<h3>' + response.reponseType + ' at ' + date + '</h3>');
How can I pull out the responseType and date to populate the title?