当我从表中搜索值时,如果表中没有值,没有找到记录,我就使用了合适的表插件
<script src="{{URL::asset('plugins/bower_components/footable/js/footable.all.min.js')}}"></script>
<script>
var defaults = {
paginate: true,
pageSize: 25,
pageNavigation: '.pagination',
pageNavigationSize: 5, // mention the number how many page numbers you want to display.
firstText: '«',
previousText: '‹',
nextText: '›',
lastText: '»',
limitNavigation: 0,
limitPreviousText: '...',
limitNextText: '...'
};
$('#demo-foo-row-toggler').footable();
// Search input
$('#demo-foo-search').on('input', function(e) {
e.preventDefault();
filtering.trigger('footable_filter', { filter: $(this).val() });
});
</script>
答案 0 :(得分:0)
添加一个空的div
<div style="display:none" id="norecord">No records found</div>
隐藏表格并显示div
$(document).ready(function(){
if ($.trim($("#demo-foo-row-toggler tbody").text()).length == 0) {
$('#demo-foo-row-toggler').hide();
$('#norecord').show();
}
});
注意:页脚中没有默认选项