如何在 JQuery DataTable 中默认显示所有行 [英] How to show all rows by default in JQuery DataTable
本文介绍了如何在 JQuery DataTable 中默认显示所有行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人知道如何在 jQuery 数据表中默认显示所有行吗?
Does anybody know how to show all rows by default in jQuery datatable?
我试过这段代码,但它默认只显示 10 行.
I have tried this code, but it only shows 10 rows by default.
$("#adminProducts").dataTable({
"aLengthMenu": [100]
});
推荐答案
使用:
$('#example').dataTable({
aLengthMenu: [
[25, 50, 100, 200, -1],
[25, 50, 100, 200, "All"]
],
iDisplayLength: -1
});
或者如果使用 1.10+
Or if using 1.10+
$('#example').dataTable({
paging: false
});
这篇关于如何在 JQuery DataTable 中默认显示所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文