回答
這裏是一個完整的HTML文檔,工程
<!DOCTYPE html>
<html>
<head>
<link href="//datatables.net/download/build/nightly/jquery.dataTables.css" rel="stylesheet" type="text/css" />
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script>
<meta charset=utf-8 />
<title>DataTables - JS Bin</title>
<script>
$(document).ready(function() {
/**/
// By index
$('#example').DataTable();
});
</script>
</head>
<body>
<div class="container">
<table id="example" class="display" width="100%">
<thead>
<tr>
<td>Name</td>
<td>Position</td>
<td>Office</td>
<td>Age</td>
<td>Start date</td>
<td class="nosort">Salary</td>
<td></td>
<td></td>
<td></td>
</tr>
</thead>
<tbody>
<tr role="row" class="odd">
<td>Ad</td>
<td>Administrator</td>
<td>07/06/2016 11:41:49</td>
<td class="sorting_1">0</td>
<td>28605</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28605" target="_blank">View</a> | <a href="globalsearch.php?queue=28605" target="_blank">Edit</a> | <a onclick="deletequeue('Ad','queue_dashboard_ajx.php?action=delete&bucket=28605')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>wkfs</td>
<td>karthik</td>
<td>02/11/2016 06:39:39</td>
<td class="sorting_1">0</td>
<td>28402</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28402" target="_blank">View</a> | <a href="globalsearch.php?queue=28402" target="_blank">Edit</a> | <a onclick="deletequeue('wkfs','queue_dashboard_ajx.php?action=delete&bucket=28402')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="odd">
<td>viswas test bucket</td>
<td>Administrator</td>
<td>07/01/2016 12:34:41</td>
<td class="sorting_1">0</td>
<td>28576</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28576" target="_blank">View</a> | <a href="globalsearch.php?queue=28576" target="_blank">Edit</a> | <a onclick="deletequeue('viswas test bucket','queue_dashboard_ajx.php?action=delete&bucket=28576')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>testallticket</td>
<td>Administrator</td>
<td>07/15/2016 08:04:32</td>
<td class="sorting_1">0</td>
<td>28661</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28661" target="_blank">View</a> | <a href="globalsearch.php?queue=28661" target="_blank">Edit</a> | <a onclick="deletequeue('testallticket','queue_dashboard_ajx.php?action=delete&bucket=28661')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="odd">
<td>test_search</td>
<td>Administrator</td>
<td>07/29/2016 06:48:42</td>
<td class="sorting_1">0</td>
<td>28682</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28682" target="_blank">View</a> | <a href="globalsearch.php?queue=28682" target="_blank">Edit</a> | <a onclick="deletequeue('test_search','queue_dashboard_ajx.php?action=delete&bucket=28682')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>test_armed_IR_update</td>
<td>Administrator</td>
<td>08/17/2016 06:44:39</td>
<td class="sorting_1">0</td>
<td>28721</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28721" target="_blank">View</a> | <a href="globalsearch.php?queue=28721" target="_blank">Edit</a> | <a onclick="deletequeue('test_armed_IR_update','queue_dashboard_ajx.php?action=delete&bucket=28721')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="odd">
<td>test_anand_sr_and_cr</td>
<td>Administrator</td>
<td>07/29/2016 06:29:13</td>
<td class="sorting_1">0</td>
<td>28680</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28680" target="_blank">View</a> | <a href="globalsearch.php?queue=28680" target="_blank">Edit</a> | <a onclick="deletequeue('test_anand_sr_and_cr','queue_dashboard_ajx.php?action=delete&bucket=28680')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>test_anand</td>
<td>Administrator</td>
<td>07/14/2016 07:32:24</td>
<td class="sorting_1">0</td>
<td>28660</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28660" target="_blank">View</a> | <a href="globalsearch.php?queue=28660" target="_blank">Edit</a> | <a onclick="deletequeue('test_anand','queue_dashboard_ajx.php?action=delete&bucket=28660')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="odd">
<td>test date filter</td>
<td>Administrator</td>
<td>07/06/2016 11:34:24</td>
<td class="sorting_1">0</td>
<td>28604</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28604" target="_blank">View</a> | <a href="globalsearch.php?queue=28604" target="_blank">Edit</a> | <a onclick="deletequeue('test date filter','queue_dashboard_ajx.php?action=delete&bucket=28604')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>test 1550</td>
<td>Administrator</td>
<td>08/17/2016 08:56:26</td>
<td class="sorting_1">0</td>
<td>28722</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28722" target="_blank">View</a> | <a href="globalsearch.php?queue=28722" target="_blank">Edit</a> | <a onclick="deletequeue('test 1550','queue_dashboard_ajx.php?action=delete&bucket=28722')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="odd">
<td>test 1</td>
<td>Administrator</td>
<td>06/17/2016 03:35:05</td>
<td class="sorting_1">0</td>
<td>28541</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28541" target="_blank">View</a> | <a href="globalsearch.php?queue=28541" target="_blank">Edit</a> | <a onclick="deletequeue('test 1','queue_dashboard_ajx.php?action=delete&bucket=28541')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
<tr role="row" class="even">
<td>test</td>
<td>Administrator</td>
<td>06/13/2016 11:30:45</td>
<td class="sorting_1">0</td>
<td>28521</td>
<td><a href="queue_dashboard_bucket_view.php?bucketid=28521" target="_blank">View</a> | <a href="globalsearch.php?queue=28521" target="_blank">Edit</a> | <a onclick="deletequeue('test','queue_dashboard_ajx.php?action=delete&bucket=28521')" href="javascript:void(0);">Delete</a> </td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
</div>
</body>
</html>
它不能正常工作。你能編輯jsbin嗎? –
@QuestionUser datatable函數不能正常工作......你確定這些鏈接有效嗎? 嘗試使用此代替//cdn.datatables.net/1.10.12/js/jquery.dataTables.min。 js –
@QuestionUser更新了我的答案:同時確保頭部TD計數與身體TD計數相同......並且您的jquery.datatable.js鏈接不工作.... –
你需要給您要添加排序列的索引這樣的數據表的訂單選項
$('#example').DataTable({
"order": [[ 0, "asc" ]]
});
這裏是工作js斌。
- 1. 數據表:排序不起作用
- 2. jquery數據錶行重排序在排序後不起作用
- 3. 排序不起作用,引導數據表格
- 4. 在primefaces數據表中排序不起作用
- 5. jquery數據表排序和rowReorder不起作用
- 6. Richfaces 3數據表排序不起作用
- 7. jQuery bootstrap數據表搜索和排序不起作用
- 8. C#排序列表不起作用
- 9. ng表排序不起作用
- 10. 鏈接列表排序不起作用
- 11. SAPUI5表排序不起作用
- 12. Java - 列表排序不起作用
- 13. Lucene.net 2.9.2排序(排序不起作用)
- 14. 數據表排序數字不工作
- 15. Ext.grid.ColumnModel排序不起作用
- 16. DataGrid排序不起作用
- 17. DataGridView排序不起作用
- 18. jqGrid排序不起作用
- 19. ElasticSearch - 排序不起作用
- 20. Firebase排序不起作用
- 21. 排序-n不起作用
- 22. .rawQuery排序不起作用
- 23. 排序不起作用
- 24. WebGrid排序不起作用
- 25. IQueryable排序不起作用
- 26. Gridview排序不起作用
- 27. 排序不起作用
- 28. ElasticSearch - 排序不起作用
- 29. list.js排序不起作用
- 30. JsGrid排序不起作用
您是使用客戶端還是服務器端數據表? –
客戶端數據表@MayankPandey –
它正是你要求它做的:''bSortable':false'在所有'目標'上===所有列===排序在任何地方完全禁用。 – davidkonrad