jqGrid垂直滚动条

5

有没有可能让jqGrid插入垂直滚动条,而不是在从分页器请求新行时增加其高度?

我的当前代码如下:

$("#grid").jqGrid({
url:'/someUrl',

datatype:"json",
mtype:'GET',
shrinkToFit:true,
forceFit:true,
autowidth:true,
altRows:true,
cellEdit:true,
altclass:'altRowClass',
multiselect:true,
rowNum:15,
height:300,
rowList:[15, 50, 100, 1000],    
rowNum:15    

});
4个回答

12
如果我正确理解了你的问题,你可以添加类似以下的CSS样式:
.ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll }

强制在网格中显示垂直滚动条。


以上答案有助于解决在IE9浏览器中显示jqGrid垂直滚动条的问题。 - santosh kumar patro
2
这是我能让它正常工作的唯一方法。$('.ui-jqgrid .ui-jqgrid-bdiv').css({ 'overflow-y': 'scroll' }); - styfle
@styfle: 我的意思是CSS的定义:<style type="text/css">.ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll }</style>。声明性CSS比在<table>上设置style属性更快。一般来说,结果应该是相同的。 - Oleg

6
尝试
 scrollerbar:true
 height:"200"

那似乎没有什么区别。 - Fred Campos

2

这就是窍门:

.ui-jqgrid-bdiv{
    max-height: 340px;
}

0

垂直滚动

gridComplete: function () {
                $('#gbox_workshopPersonGrid .ui-jqgrid-bdiv').css({ 'height': '100%', 'max-height': '450px', 'overflow-y': 'scroll', 'overflow-x': 'hidden' });
            }

注意:workshopPersonGrid是您的网格名称


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接