我在我的网站中使用了jQuery DataTable,显示了我们客户的所有法律列表,我目前正在使用jQuery DataTable插件进行分页,搜索和排序。它工作正常除了一个问题,当我多次点击分页时数据加载非常慢。我真的不确定是什么问题。
干杯!提前谢谢!
我的网站:http://law.darwinkh.org/en/legal-database
这是我的代码
if($('#legal-database').length) {
var tableLaw = jQuery('#legal-database').dataTable({
"processing": true,
"serverSide": true,
"oLanguage": {
"sSearch": "Search",
"sProcessing": "Processing...",
"sLoadingRecords": "Processing...",
"sLengthMenu": "Show _MENU_ entries",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sEmptyTable": "No data available in table",
"oPaginate": {
"sFirst": "First",
"sLast": "Last",
"sNext": "Next",
"sPrevious": "Previous"
}
},
"ajax": {
"url": "http://law.darwinkh.org/en/legal-database/law-grid-data",
"type": "POST",
"data": {
catid: 0 },
"cache": false
},
"columns": [
{ "data": "id" },
{ "data": "title" },
{ "data": "year" },
{ "data": "type" },
{ "data": "slug" }
],
"order": [[ 0, "desc" ]],
initComplete: function () {
}
});
}