我使用的代码如下所示使用简单的DataTable。我得到的数据和所有的排序是伟大的,但现在我想更新最后一列中的单元格内容,这是“未覆盖的原因”列,并将其作为可能通过AJAX调用的数据库更新提交回来。我不确定是使用Editor还是使用JEditable来编辑表格,以及如何仅编辑该表格。尝试了使用makeEditable和Editor的不同选项,但不能使列或单元格的内联单元格内容可编辑。在脚本路径中有dataTables.editor.min.js。也试过jEditable与jquery.jeditable.mini.js任何帮助深表谢意。如何使jQuery表格仅可编辑特定列
的jquery-3.1.1.min.js,jquery.dataTables.min.js,dataTables.buttons.min.js,buttons.colVis.min.js,dataTables.editor.min.js
<script>
$(document).ready(function() {
$('#selectedDetails').DataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"fixedHeader": true,
"scrollY": '400px'
});
});</script>
<table id = "selectedDetails" class="table table-striped table-bordered" cellspacing="0" width="80%">
<caption><h3>DETAILS FOR SELECTED FILTERS: <font color="brown">FORM ID</font>=<font color="blue"><%=request.getAttribute("formNameSelection")%></font> AND <font color="brown">COVERED IN AUTOTAX</font> = <font color="blue"><%=request.getAttribute("YesOrNoValueSelection") %></font> </h3></caption>
<thead style="background-color:#D7DBDD; border:solid 2px; border-color:black">
<tr>
<th>FORM ID</th>
<th>FIELD ID</th>
<th>FIELD NAME</th>
<th>FIELD TYPE</th>
<th>NO: OF HARD CALCS</th>
<th>NO: OF DROP ASSIGNEDS</th>
<th>COVERED IN AUTOTAX ?</th>
<th>REASON NOT COVERED</th>
</tr>
<thead>
</thead>
<tbody>
<c:forEach var="filterFieldInfo" items="${filteredValues}">
<tr>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.formId}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.fieldId}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.fieldName}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.fieldType}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.numHardCalcs}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.numDroptAssigneds}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.autoTaxCovered}" /></td>
<td style="width: 45px;text-align: center;" align="center"><c:out value="${filterFieldInfo.reasonAutoTaxCovered}" /></td>
</tr>
</c:forEach>
</tbody>
</table>
我有一个按钮控件完全可编辑的表在这里http://jsbin.com/yafuvah/1/edit?js,output – Bindrid
我实际上创建了一个表,使用内容可编辑在我的用户使用的表上的两个字段上。我会努力记住张贴在周一的代码,如果这是还是有帮助的 – Bindrid
谢谢@Bindrid,我想你的第一个解决方案,但无法让它列的编辑..in其实没有一个编辑,我显然缺少一些东西。 –