數據表1.10.12如何在DataTables中啓用排序(延遲加載)?
排序不適合我DataTables實施工作。我使用延遲加載的數據。
如何使分揀工作?
var hash_table = $('#hash_table');
var data_table = hash_table.DataTable({
processing: true,
serverSide: true,
deferLoading: 100,
ordering: true,
order: [[ 0, 'asc' ]],
ajax: {
url: 'get_hashes/',
type: 'POST',
},
columns: [
{'title': 'BRC ID', 'data': 'brc_id'},
{'title': 'HASH', 'data': 'hash'}
],
dom: 'Brtip',
buttons: [
{
extend: 'excel',
title: 'report',
text: 'Export',
extension: '.xlsx'
}
]
});
data_table.draw();
如果我點擊列標題中的排序圖標,結果不會改變。
這不提供問題的答案。一旦你有足夠的[聲譽](http://stackoverflow.com/help/whats-reputation),你將能夠[評論任何職位](http://stackoverflow.com/help/privileges/comment);相反,[提供不需要提問者澄清的答案](http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can- I-DO-代替)。 - [來自評論](/ review/low-quality-posts/14091825) – VDWWD
這確實提供了一個答案,因爲這是我用來排序在我們的數據表 –
您確定您使用數據表來延遲加載數據嗎? https://datatables.net/examples/server_side/defer_loading.html – trex