例如,如果我有一个带有“ID”列的表,ID下的值将在每一行中重复两次。此问题仅存在于Ie9中。请建议可能的解决方案。 我的Html标记如下。
<script>
var viewModels;
requirejs(
["vm.attendanceMarking", "vm.bookcab"],
function (vmattendanceMarking, vmbookcab) {
viewModels = {
vmattendanceMarking: vmattendanceMarking,
vmbookcab: vmbookcab
};
vmattendanceMarking.VMobsCabDetails();
viewModels.vmattendanceMarking.VMinit();
viewModels.vmbookcab.VMGetCabRequestData();
$(document).ready(function () {
ko.applyBindings(viewModels);
});
});
</script>
<tbody>
<!-- ko foreach: AttendanceList -->
<tr id='myrows' data-bind="attr: { id: 'row-' + tripId }">
<td>
<div style="display:inline-block">
<label data-bind="text: EmployeeId" />
</div>
</td>
<td>
<div style="display:inline-block">
<label data-bind="text: slot" />
</div>
</td>
<td>
<div style="display:inline-block">
<input type="checkbox" data-bind="checked: IsPresent">
</div>
</td>
<td>
<div style="display:inline-block">
<input type="checkbox" data-bind="checked: IsChecked">
</div>
</td>
</tr>
<!-- /ko-->
</tbody>
IE9中生成的表格标记:
<tbody>
<tr>
<td>
<label data-bind="text: EmployeeId" />
Bangalore
<label data-bind="text: EmployeeId" />
Bangalore
</td>
</tr>
</tbody>