gpt4 book ai didi

datatables - jQuery dataTables隐藏“显示条目”文本,但显示下拉列表

转载 作者:行者123 更新时间:2023-12-04 22:19:51 24 4
gpt4 key购买 nike

jQuery dataTables隐藏“显示条目”文本,但在页面右侧显示下拉列表。

$('#myTable_reports_view').DataTable({
"aoColumnDefs": [
{"bSortable": false, "aTargets": [2,3,4,5,7]}
],
"bFilter": false,
"bInfo": false,
"bLengthChange": true
});

我正在添加此代码。问题是“显示DDL条目”正在隐藏,但我只想隐藏文本部分,而不是下拉列表。

最佳答案

是的,隐藏lengthmenu隐藏文本和lengthmenu。如果您只是想摆脱“显示XX条目”文本,则只需更改该特定元素的语言设置即可。默认设置为:

"oLanguage": {
"sLengthMenu": "Show _MENU_ entries"
}

在初始化时重置:

$('#myTable_reports_view').DataTable({
"bFilter": false,
"bInfo": false,
"bLengthChange": true,
oLanguage: {
sLengthMenu: "_MENU_",
}
});

现在,您将只有下拉列表,没有前缀/后缀。这是所有 oLanguage默认值的摘要列表:

"oLanguage": {
"oAria": {
"sSortAscending": ": activate to sort column ascending",
"sSortDescending": ": activate to sort column descending"
},
"oPaginate": {
"sFirst": "First",
"sLast": "Last",
"sNext": "Next",
"sPrevious": "Previous"
},
"sEmptyTable": "No data available in table",
"sInfo": "Showing _START_ to _END_ of _TOTAL_ entries",
"sInfoEmpty": "Showing 0 to 0 of 0 entries",
"sInfoFiltered": "(filtered from _MAX_ total entries)",
"sInfoPostFix": "",
"sDecimal": "",
"sThousands": ",",
"sLengthMenu": "Show _MENU_ entries",
"sLoadingRecords": "Loading...",
"sProcessing": "Processing...",
"sSearch": "Search:",
"sSearchPlaceholder": "",
"sUrl": "",
"sZeroRecords": "No matching records found"
}

关于datatables - jQuery dataTables隐藏“显示条目”文本,但显示下拉列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31580366/

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