1
我有我的html頁面,其中包含一個表格。我使用dataTable插件進行分頁。 1DataTable分頁不起作用?
1https://datatables.net/examples/basic_init/alt_pagination.html
我的HTML如下。
<head>
<script src="https://code.jquery.com/jquery-1.12.4.js"
type="text/javascript"></script>
<script type="text/javascript"
src=" https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script type="text/javascript"
src=" https://cdn.datatables.net/buttons/1.2.4/js/dataTables.buttons.min.js"></script>
<style type="text/css">
table, th,td{
border: 1px solid black;
text-align:center;
}
#clients_data {
margin-bottom:100px;
}
</style>
<meta charset="UTF-8">
<link rel="stylesheet"
href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<title>Clients</title>
</head>
<body>
<table style="width: 100%" id="clients_data" class="display" >
<caption>Clients</caption>
<thead>
<tr>
<th>Clients</th>
<th>Number of Sites</th>
<th>Reset the Processing</th>
</tr>
</thead>
</table>
<table style="width: 100%" id="machines_data">
<caption>Machines</caption>
<thead>
<tr>
<th>Number</th>
<th>Machine Name</th>
</tr>
</thead>
</table>
<script type="text/javascript">
$(document).ready(function() {
loadCustomers();
loadMachines();
});
function loadCustomers() {
$
.ajax({
type : 'GET',
url : 'http://localhost:8080/cache/getCustomers',
dataType : 'json',
success : function(data) {
var rows = [];
$
.each(
data,
function(id, value) {
rows
.push(' <tbody><tr><td><a href="clientSiteInfo.html?client='
+ id
+ '">'
+ id
+ '</td><td>'
+ value
+ '</td><td><button type="button" onclick="reset(\''
+ id
+ '\')">Reset</td></tr> </tbody>');
});
$('#clients_data').append(rows.join(''));
$('#clients_data').DataTable({
"pagingType" : "full_numbers"
});
}
});
};
.......
加載數據,但分頁不起作用。意味着當我每頁設置10個條目時,它顯示所有條目..我附上了屏幕截圖。 AM我錯過任何其他插件? 但在提到教程,它說我需要使用「pagingType」:預期「full_numbers」唯一屬性..
一個更簡單的問題..我已經做了所有我的HTML頁面相同。 (意味着,數據表設置,這是鏈接到這個主頁)但我沒有看到任何dataTable分頁在其他網頁..什麼即時做錯了? – Ratha
@Ratha,很難說不知道更多。數據表初始化是否正確?例如,我是否有一個搜索框?你是否將'paging'設置爲false(你不應該)?你是否將'pagingType'設置爲某個奇數值? 'full_numbers'是默認的,所以你真的不需要設置它。當你像編程那樣插入數據時,你有可能在數據構建之前意外地初始化表*,你確定該表是在你插入一個'
'(或你做什麼)之後初始化的其他表? – davidkonrad謝謝somuch ..我錯過了標籤在我的鏈接html頁面的表格中 – Ratha
相關問題
-
1. DataTable分頁不起作用
-
2. jquery datatable服務器端分頁不起作用
-
3. Primefaces DataTable SortBy不起作用
-
4. jquery分頁不起作用
-
5. 分頁不起作用
-
6. Bootstrap分頁不起作用
-
7. WordPress分頁不起作用
-
8. 分頁符不起作用
-
9. Datatables分頁不起作用
-
10. Cakephp分頁不起作用?
-
11. Codeigniter - 分頁不起作用
-
12. Onpage分頁不起作用
-
13. Laravel分頁不起作用。
-
14. RecyclerView分頁不起作用
-
15. Django分頁不起作用
-
16. Wordpress分頁不起作用
-
17. Angularjs分頁不起作用
-
18. 分頁不起作用
-
19. yii2分頁不起作用
-
20. PHP分頁不起作用
-
21. Yii:分頁不起作用
-
22. CodeIgniter - 分頁不起作用
-
23. CodeIgniter分頁不起作用
-
24. PyroCMS分頁不起作用
-
25. Codeigniter分頁不起作用
-
26. jekyll - 分頁不起作用
-
27. jquery datatable中使用angularJS自定義分頁不工作在第二頁起
-
28. bootstrap datatable分頁表不工作
-
29. 分機js 6分頁不起作用
-
30. Jquery datatable操作不起作用
最新問題
-
1. 權限被拒絕npm install的錯誤
-
2. 雪花支持按小時微分區羣集?
-
3. 根據內部數組上的對象的屬性對數組進行排序
-
4. Three.js - 爲什麼這些項目的影子看起來像這樣?
-
5. 如何使用_和|使JavaScript的數字形狀?
-
6. 列表名單的移調
-
7. 內存泄漏會發生什麼?
-
8. 如何將帶有「java方法簽名」格式的字符串分解成部分?
-
9. 如何通過套接字在cpp中傳輸位圖數據?
-
10. window.onpopstate - 我是否需要刪除此事件處理程序?
-
1. DataTable分頁不起作用
-
2. jquery datatable服務器端分頁不起作用
-
3. Primefaces DataTable SortBy不起作用
-
4. jquery分頁不起作用
-
5. 分頁不起作用
-
6. Bootstrap分頁不起作用
-
7. WordPress分頁不起作用
-
8. 分頁符不起作用
-
9. Datatables分頁不起作用
-
10. Cakephp分頁不起作用?
相關問題