gpt4 book ai didi

javascript - 从 Jquery 数据表中隐藏 LengthMenu

转载 作者:行者123 更新时间:2023-12-03 21:38:08 25 4
gpt4 key购买 nike

请问如何从 Jquery 数据表中隐藏 LengthMenu(显示每页显示的记录数的下拉列表)?

目前我可以禁用它,但我根本不希望它出现。看我的Fiddle here如下:-

testdata = [{"id":"58","country_code":"UK"},{"id":"59","country_code":"US"}];
$('#test').dataTable({
"aaData": testdata,
"aoColumns": [
{ "mDataProp": "id" },
{ "mDataProp": "country_code" }
],
"bLengthMenu" : false, //thought this line could hide the LengthMenu
"bInfo":false,
});
`//the next 2 lines disables the LengthMenu
//var aLengthMenu = $('select[name=test_length]');
//$(aLengthMenu).prop('display', 'disabled');

最佳答案

尝试使用

$('#test').dataTable({
"aaData": testdata,
"aoColumns": [
{ "mDataProp": "id" },
{ "mDataProp": "country_code" },
{ "mDataProp": "title" },
{ "mDataProp": "pubdate" },
{ "mDataProp": "url" }
],
"bLengthChange" : false, //thought this line could hide the LengthMenu
"bInfo":false,
});

Fiddle

关于javascript - 从 Jquery 数据表中隐藏 LengthMenu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19928753/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com