我正在使用jQuery数据表。
我想删除默认情况下添加到表中的搜索栏和页脚(显示有多少行可见)。我只是想用这个插件来排序。这能做到吗?
我正在使用jQuery数据表。
我想删除默认情况下添加到表中的搜索栏和页脚(显示有多少行可见)。我只是想用这个插件来排序。这能做到吗?
当前回答
在这里你可以添加到sDom元素到你的代码,顶部搜索栏是隐藏的。
$(document).ready(function() {
$('#example').dataTable( {
"sDom": '<"top">rt<"bottom"flp><"clear">'
} );
} );
其他回答
你可以通过css隐藏它们:
#example_info, #example_filter{display: none}
在这里你可以添加到sDom元素到你的代码,顶部搜索栏是隐藏的。
$(document).ready(function() {
$('#example').dataTable( {
"sDom": '<"top">rt<"bottom"flp><"clear">'
} );
} );
这对我很管用;
你可以使用这个属性在表上删除搜索栏:
<script>
$(document).ready(function() {
$('#nametable').DataTable({
"bPaginate": false,
"bFilter": false,
"bInfo": false
});
});
</script>
在数据表构造函数中
https://datatables.net/forums/discussion/20006/how-to-remove-cross-icon-in-search-box
如果你正在使用themeroller:
.dataTables_wrapper .fg-toolbar { display: none; }