当我在脚本中评论“响应”时,一切都会好起来,但表格没有响应。当我在脚本中注释最后一个数据列(用于编辑)并启用响应时,该表是响应的,但我没有最后一列。当我同时激活(最后一列和响应)它不会触发处理程序并继续处理......这里有什么问题?
var table = $('.dataTable').DataTable({
"bProcessing": true,
"bServerSide": true,
"responsive": true,
"sAjaxSource": "/View/test/test3Handler.ashx",
"columns": [
{ 'data': 'field_1' },
{ 'data': 'field_2' },
{ 'data': 'field_3' },
{ 'data': 'field_4' },
{ 'data': 'field_5' },
{ 'data': 'field_6' },
{
'data': null,
'sortable': false,
'searchable': false,
'render': function () {
return '<a class="editMe" role="button"><img src="/images/edit.png" width="25px" /></a>';
}
},
],
});
<table id="dtbl" class="display dataTable">
<thead>
<tr style="text-align:left;">
<th>field_1</th>
<th>field_2</th>
<th>field_3</th>
<th>field_4</th>
<th>field_5</th>
<th>field_6</th>
<th>Edit</th>
</tr>
</thead>
<tbody></tbody>
<tfoot>
<tr>
<th><input type="search" placeholder="Search field_1"></th>
<th><input type="search" placeholder="Search field_2"> </th>
<th><input type="search" placeholder="Search field_3"></th>
<th><input type="search" placeholder="Search field_4"></th>
<th><input type="search" placeholder="Search field_5"></th>
<th><input type="search" placeholder="Search field_6"></th>
</tr>
</tfoot>
</table>