【问题标题】:jqGrid vertical scrollbarjqGrid垂直滚动条
【发布时间】:2013-01-24 13:34:46
【问题描述】:

是否可以让 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    

});

【问题讨论】:

    标签: jqgrid


    【解决方案1】:

    如果我正确理解您的问题,您可以添加 CSS 之类的

    .ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll }
    

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

    【讨论】:

    • 以上回答解决了jqGrid for IE9浏览器显示垂直滚动条的问题。
    • 这是我让它工作的唯一方法。 $('.ui-jqgrid .ui-jqgrid-bdiv').css({ 'overflow-y': 'scroll' });
    • @styfle:我的意思是 CSS 的定义:<style type="text/css">.ui-jqgrid .ui-jqgrid-bdiv { overflow-y: scroll }</style>。在 <table> 上设置 style 属性时,声明式 CSS 工作得更快。一般来说,结果应该是一样的。
    【解决方案2】:

    试试

     scrollerbar:true
     height:"200"
    

    【讨论】:

    • 这似乎没什么区别。
    【解决方案3】:

    这成功了:

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

    【讨论】:

      【解决方案4】:

      垂直滚动

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

      注意:workshopPersonGrid 是您的网格名称

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2014-09-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多