我有一个数据表,它使用服务器端分页和无限滚动。因此,当我向下滚动表格时,我的页面会加载。现在默认页面大小为10.如何覆盖此数字? 我尝试设置iDisplayLength:50,但没有用。
ListDataTable= $("#ListDataPane_data").dataTable({
"iDisplayLength":50,
"bFilter": true,
"bServerSide": true,
"sServerMethod": "POST",
"sAjaxSource": ListResourcePaginationUrl,
"bProcessing": true,
"sPaginationType": "full_numbers",
"bJQueryUI": false,
"bDestroy": true,
"bScrollInfinite": true,
"sScrollY": "300px",
"sScrollX": "963px",
"fnServerParams": function (aaData) {
aaData.push(
{ "name": "Status", "value": status}
);
});
},
请帮忙。
答案 0 :(得分:0)
可能是server doesn't respect iDisplayLength值。在这种情况下,您还必须更新服务器端。
答案 1 :(得分:0)
" iDisplayLength":50个工作,我只需要清除浏览器缓存。
答案 2 :(得分:0)
在更改iDisplayLength字段值后,您应该在DataTable中调用fnDraw方法: table.fnSettings()。iDisplayLength = 20; 和 table.fnDraw();