我有一个看起来像这样的表:
编辑:
<table id="results">
<thead>
<tr>
<th>ID</th>
<th>NAME</th>
<th>NUMBER</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#" onclick="$('#user_1').toggle();">1</a></td>
<td>JOHN</td>
<td>311-123-4523</td>
</tr>
<tr id="user_1" class="hide">
<td colspan="3">
Some information about the user
</td>
</tr>
</tbody>
</table>
<script>
$(document).ready(function(){
$('#results').dataTable({
"sPaginationType": "bootstrap"
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
注意:单击ID号,显示/隐藏详细信息行.
我在dataTable尝试使用colspan渲染表时遇到问题,我收到此错误
Uncaught TypeError: Cannot read property 'asSorting' of undefined
Run Code Online (Sandbox Code Playgroud)
如果我删除详细信息行,datatable会使一切正常.
我想知道是否有可能告诉dataTable忽略如上所述的细节行.
| 归档时间: |
|
| 查看次数: |
11556 次 |
| 最近记录: |