名
類型
是否為空
默認(rèn)值
備注
data:
{
"data":[
{"1":1,
"2":2,
"3":3,
"4":4,
"5":5,
},
{"1":1,
"2":2,
"3":3,
"4":4,
"5":5,
}
]
}
$.getJSON(url, function (data, textStatus) {
$("#table1").dataTable().fnClearTable();
$("#table1").dataTable().fnDestroy();
var data1 = data['data']
$('#table1').DataTable({
data: data1,
columns: [
{data: '1'},
{data: '2'},
{data: '3'},
{data: '4'},
{data: '5'}
],
"oLanguage": {
"sLengthMenu": "每頁顯示 _MENU_ 條記錄",
"sZeroRecords": "對(duì)不起,查詢不到任何相關(guān)數(shù)據(jù)",
"sInfo": "當(dāng)前顯示 _START_ 到 _END_ 條,共 _TOTAL_條記錄",
"sInfoEmtpy": "找不到相關(guān)數(shù)據(jù)",
"sInfoFiltered": " 數(shù)據(jù)表中共為 _MAX_ 條記錄",
"sProcessing": "正在加載中...",
"sSearch": "搜索",
"oPaginate": {
"sFirst": "第一頁",
"sPrevious": " 上一頁 ",
"sNext": " 下一頁 ",
"sLast": " 最后一頁 "
}
},
dom: '<"html5buttons"B>lTfgitp,',
{#"order": [[0, 'desc']],#}
"ordering": false, // 禁止排序
buttons: ['copy', 'csv', 'excel']
});
});