如何禁用 jquery 数据表中的显示条目属性
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20785926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to disable show entries property in jquery datatable
提问by shanthi_karthika
I have just started working with jquery. I used jquery data-table plugin for enabling table-view. Iam in need to disable show entries property. Can anyone help me in which js i need to disable the property?
我刚刚开始使用 jquery。我使用 jquery 数据表插件来启用表视图。我需要禁用显示条目属性。任何人都可以帮助我在哪些 js 中需要禁用该属性?
I had followed this link but doesn't help. I don't know which js has to be modified. here
我已经关注了这个链接,但没有帮助。不知道要修改哪个js。 这里
Thanks in Advance
提前致谢
回答by shanthi_karthika
This had worked for me. Use the code in your html you have built
这对我有用。使用您构建的 html 中的代码
$(document).ready(function () {
var oTable = $('#example').dataTable({
"aaData": orgContent,
"bLengthChange": false //used to hide the property
});
As per latest documentation bLengthChangein above piece of code should be lengthChange.
根据最新文档,上面这段代码中的bLengthChange应该是lengthChange。
回答by Ziad
you need to use this code:
您需要使用此代码:
$('#example').dataTable({
"bInfo": false
});
回答by Asanga Dewaguru
notice the "paging" property in below example. once you set it to false. Show entries will get disabled.
注意下面示例中的“分页”属性。一旦你将它设置为 false。显示条目将被禁用。
$(document).ready(function() {
$('#your_table_name').dataTable( {
"paging": false,
"ordering": false,
"info": false
} );
} );
回答by Gabriel Jeremy Rodriguez River
this works for me:
这对我有用:
<table class="dataTable" data-role="datatable" data-info="false">
<tr>
<td></td>
</tr>
</table>
it's all.
这就是全部。