[英]Datatables doesn't recognize pageLength for number of rows
I'm simply trying to have only 15 rows when I bring my data up. 我只是想把数据提起来只有15行。 For some reason it is not working.
由于某种原因,它无法正常工作。 Any help would be appreciated.
任何帮助,将不胜感激。
$('.datatable').dataTable({
"processing": true,
"serverSide": true,
"ajax": {
"url": "/ajaxI/gd/1/54",
"data": function (d) {
}
},
"paging": true,
"searching": false,
"lengthChange": true,
"lengthMenu": [[15, 25, 50, -1], [15, 25, 50, "All"]],
"pageLength": 15,
"oLanguage": {
"sProcessing": ' <img src="/img/ajax-loader-large.gif" alt="Loading" width="26" height="26" />'
},
"autoWidth" : false }
});
All my data shows up for some weird reason. 我的所有数据都出现了一些奇怪的原因。
On the table element, use: 在table元素上,使用:
data-page-length='15' eg data-page-length ='15'例如
<table id="table" class="" data-page-length='15' >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.