查过相关资料别人都是通过在加载数据是判断是空数据后再进行空数据处理,这样操作起来不便,而且代码过多。其实jqgrid存在一个属性emptyrecords,用于数据为空时在右下角提示信息。经过样式处理后可以有很多变化。下面是我的代码:
emptyrecords:"<div style='position: absolute;top: 0%;left: 0%;width: 100%;height: 30px;z-index: 101;padding: 6px;margin: 5px;text-align: center;font-weight: bold;font-size: 14px;background-color: #FFF;border: 2px solid #8EB8D1;color: #E2B018;display: block;'>暂 无 数 据</div>",
效果如下: