我需要用基因敲除的foreach结合嵌套数组援助。
下面是代码,想知道我怎样才能得到这里面PatAppointments数组中的元素。
<script language="javascript" type="text/javascript">
ko.applyBindings({
"appointment": [{
"Date": "01\/10\/2012",
"PatAppointments": [{
"EndTime": "11:15:00",
"EventId": null,
"Facility": "General Physician",
"PatientID": 23,
"PatientName": "Vicki"
}],
"PatAppointments": [{
"EndTime": "11:15:00",
"EventId": null,
"Facility": "General Physician",
"PatientID": 23,
"PatientName": "Scott"
}]
}]
});
</script>
<table>
<tbody data-bind="foreach: appointment">
<tr>
<td data-bind="text: Date">
</td>
</tr>
<tr>
<td>
@*
<tbody data-bind="foreach: appointment.PatAppointments">
<tr>
<td data-bind="text: PatAppointments.PatientName">
</td>
<td data-bind="text: PatAppointments.Facility">
</td>
</tr>
</tbody>
*@
</td>
</tr>
</tbody>
</table>