我正在使用jQuery DataTables在同一页面的两个单独的表中填充数据。但是,我收到以下错误:
oCol未定义
..在对话框中。请帮我解决这个问题。这是我的代码:
<table class="assignment">
<tr>
<th>Available Product License Types</th>
<th></th>
<th>Assigned Product License Types</th>
</tr>
<tr>
<td class="leftcontent">
Select: <a href="#" onclick="return ASLM.Datatables.selectAll ($('#availableProductLicenseTypeTable'));">all</a>, <a href="#" onclick="return ASLM.Datatables.selectNone($('#availableProductLicenseTypeTable'));">none</a> <table id="availableProductLicenseTypeTable" class="display small noshadow">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>View Only</th>
</tr>
</thead>
<tbody>
<c:forEach var="availableProductLicenseType" items="${availableProductLicenseType}">
<tr>
<td>
${availableProductLicenseType.id}
</td>
<td>
${availableProductLicenseType.productFamilyName}${' '}${availableProductLicenseType.productName}
<c:choose>
<c:when test="${availableProductLicenseType.needsExplicitAssignment}">*${availableProductLicenseType.licenseTypeName}
</c:when>
<c:otherwise>${availableProductLicenseType.licenseTypeName}
</c:otherwise>
</c:choose>
</td>
<td>${availableProductLicenseType.isViewOnly}
</td>
</tr>
</c:forEach>
</tbody>
</table>
</td>
<td class="buttons">
<input type="button" value=">" onclick="moveProductLicenseTypesAvailableToAssigned()"/></br>
<input type="button" value="<" onclick="moveProductLicenseTypesAssignedToAvailable()"/></br>
</td>
<td class="rightcontent">
Select: <a href="#" onclick="return ASLM.Datatables.selectAll($('#assignedProductLicenseTypeTable'));">all</a>,
<a href="#" onclick="return ASLM.Datatables.selectNone($('#assignedProductLicenseTypeTable'));">none</a>
<table id="assignedProductLicenseTypeTable" class="display small noshadow">
<thead>
<tr>
<th>ID</th>
<th>Name</th>
<th>View Only</th>
</tr>
</thead>
<c:forEach var="assignedProductLicenseType" items="${assignedProductLicenseType}">
<tr>
<td>
${assignedProductLicenseType.id}
</td>
<td>
${assignedProductLicenseType.productFamilyName}${' '}${assignedProductLicenseType.productName}
<c:choose>
<c:when test="${assignedProductLicenseType.needsExplicitAssignment}">*${assignedProductLicenseType.licenseTypeName}
</c:when>
<c:otherwise>${assignedProductLicenseType.licenseTypeName}
</c:otherwise>
</c:choose>
<input type="checkbox" name="isViewOnly" id="isViewOnlyId" value="${assignedProductLicenseType.isViewOnly}" />
</td>
<td>${assignedProductLicenseType.isViewOnly}
</td>
</tr>
</c:forEach>
</table>
</td>
</tr>
</table>
答案 0 :(得分:0)
DataTables想要这种格式:
<table>
<thead>
<tr>
<td>Col 1 head</td>
<td>Col 2 head</td>
<td>Col 3 head</td>
</tr>
</thead>
<tbody>
<tr>
<td>Col 1 body</td>
<td>Col 2 body</td>
<td>Col 3 body</td>
</tr>
</tbody>
</table>