在无数据的时候在表单中显示无数据显示,右下角的小字太不明显了
其实感觉右下角也不错。要在中间显示的话,如下 样式,拿loading样式用的,自己可以改 .norecords { border-width: 2px !important; display:none; font-weight: bold; left: 45%; margin: 5px; padding: 6px; position: absolute; text-align: center; top: 45%; width: auto; z-index: 102; } 在jqGrid的loadComplete函数里面加判断,假设table的id是list loadComplete: function(){ var re_records = $("#list").getGridParam('records'); if(re_records == 0 || re_records == null){ if($(".norecords").html() == null){ $("#list").parent().append("<div class=\"norecords\">没有符合数据</div>"); } $(".norecords").show(); } } 当然在重新查询前要先隐藏norecords,比如reloadGrid前 $(".norecords").hide(); $("#list").trigger("reloadGrid");