We're talking to an existing web service that is returning the data in a JSON format along these lines (excuse any format typos as this is mocked data):
{
"SelectedLocationID": 123,
"SelectedPeriodID": 234,
"DOBShifts": {
"Monday 9/21/2015": [
{
"ResultID": 1,
"DOB": "9/21/2015",
"JobID": 1,
"JobName": "Job 1",
"StartTime": "9/21/2015 12:00:00 PM",
"EndTime": "9/21/2015 4:00:00 PM",
"EmployeeName": "employee 1",
"EmployeeID": 1
"Color": " "
},
{
"ResultID": 2,
"DOB": "9/21/2015",
"JobID": 1,
"JobName": "Job 1",
"StartTime": "9/21/2015 1:00:00 PM",
"EndTime": "9/21/2015 5:00:00 PM",
"EmployeeName": "employee 2",
"EmployeeID": 2,
"Color": " "
}
],
"Tuesday 9/22/2015": [
...
]
}
}
Is there a way to bind the model fields to this nested JSON data, especially with the data stamps that will vary inside the DOBShifts node? Something like
taskId: { from: "DOBShifts.(formatteddate?).ResultID", type: "number" }
Or would a better approach be to pull this data into a separate function, format it in a simpler object, then map that datasource?
Thanks.