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. 分頁不起作用
-
5. CodeIgniter - 分頁不起作用
-
6. yii2分頁不起作用
-
7. jquery分頁不起作用
-
8. CodeIgniter分頁不起作用
-
9. Angularjs分頁不起作用
-
10. Codeigniter - 分頁不起作用
-
11. Datatables分頁不起作用
-
12. Cakephp分頁不起作用?
-
13. 分頁不起作用
-
14. Codeigniter分頁不起作用
-
15. jekyll - 分頁不起作用
-
16. jquery datatable中使用angularJS自定義分頁不工作在第二頁起
-
17. bootstrap datatable分頁表不工作
-
18. Datatable jquery第二頁記錄刪除事件不起作用
-
19. DataTable的jQuery插件不起作用。 fnGetColumnData
-
20. AngularJS Datatable:響應不起作用
-
21. AngularJS dataTable,$ http get不起作用
-
22. dataTable TableTools複製按鈕不起作用
-
23. Grid.MVC的分頁不起作用
-
24. Codeigniter搜索與分頁不起作用
-
25. 對asp:DataGrid分頁不起作用
-
26. jquery簡單分頁不起作用
-
27. 分頁存儲過程不起作用
-
28. WordPress的類別分頁不起作用
-
29. Codeigniter的分頁不起作用
-
30. 智能表分頁不起作用
最新問題
-
1. 在樹狀視圖中構建遠程機器(LAN)的目錄結構
-
2. PHP類:寫對象內的函數?
-
3. 想法解決一個簡單的任務與PHP和jQuery
-
4. 如何在使用Parcelable的活動之間傳遞具有其他對象列表的對象?
-
5. Laravel究竟是如何處理交易死鎖的?
-
6. 測試與具有動態地產生的場的形式的控制器
-
7. 爲什麼我的單元測試試圖插入一個記錄,當我不問它?
-
8. ArangoDB:Foxx服務中的交易限制
-
9. org.w3c.dom.Document gwt轉換器在GWT中的字符串
-
10. 驗證字符串consiting只有字母,數字和可選的空間
-
1. DataTable分頁不起作用
-
2. jquery datatable服務器端分頁不起作用
-
3. Primefaces DataTable SortBy不起作用
-
4. 分頁不起作用
-
5. CodeIgniter - 分頁不起作用
-
6. yii2分頁不起作用
-
7. jquery分頁不起作用
-
8. CodeIgniter分頁不起作用
-
9. Angularjs分頁不起作用
-
10. Codeigniter - 分頁不起作用
相關問題