jqgrid工作记录1(单元格内容过长三个点显示,表头自动换行,取消滚动条预留空间)

①单元格内容过长三个点显示

效果如下:

页面加入css:

1 <style>
2     .ui-jqgrid tr.jqgrow td {
3         white-space: nowrap;
4         text-overflow: ellipsis;
5     }
6 </style>

②表头自动换行

效果如下:

 

页面加入css:

1 <style>
2     th.ui-th-column div {
3         white-space: normal !important;
4         height: auto !important;
5     }
6 </style>

 ③取消滚动条预留空间

取消前世这样的:

取消后是这样的:

影响美观的白色空白消失了

需要在jqgrid的配置中加上:scrollOffset:0,

 1 jqGrid = $("#jqgrid-tab").loadJqGrid({
 2     url: url,
 3     postData: json,
 4     pageSelector: "jqgrid-pager",
 5     colNames: [ *** ],
 6     colModel: [ *** ],
 7     height:jqgridHeight,
 8     rowNum:20,
 9     scrollOffset:0,
10     rowList:[20,50,100,500]
11 });
昔日我曾苍老,如今风华正茂(ง •̀_•́)ง
原文地址:https://www.cnblogs.com/lgqrlchinese/p/11864654.html