jqGrid horizontal scrollbar

前端 未结 13 2090
终归单人心
终归单人心 2020-12-13 09:28

I developed AJAX interface with jQuery and jqGrid.

How I can remove horizontal scrollbar from my jqGrid table?

http://dskarataev.ru/jqgrid.png

If I s

相关标签:
13条回答
  • 2020-12-13 09:45

    setGridWidth will definitely resize your grid to that of the given new width, but make sure you use it with autowidth=true. setGridWidth may have problem with IE 7 or so.

    Some working solutions discussed here (in case if you are yet to find a solution),

    Resize jqGrid when browser is resized?

    http://www.trirand.com/blog/?page_id=393/discussion/browser-resize-how-to-resize-jqgrid/

    ----old----

    There are couple of options you can try,

    From http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options

    "autowidth" : true    
    

    or

    "shrinkToFit": false
    

    Otherwise post your jqgrid code, let us analyze.

    0 讨论(0)
  • 2020-12-13 09:46

    a bit late, but might be useful for someone

    You must set the height of the table only in numbers, without 'px' at the end

    0 讨论(0)
  • 2020-12-13 09:47

    There are some situations where jqGrid calculate the grid width incorrect. You can try to increase cellLayout parameter (see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:options). This may be needed if you change some CSS from jqGrid.

    In some other situations you can correct the width with respect of the function fixGridWidth or fixGridSize which I have described in Correctly calling setGridWidth on a jqGrid inside a jQueryUI Dialog. Don't forget, that you should use it inside of loadComplete.

    0 讨论(0)
  • 2020-12-13 09:47

    This works for me

     <style type="text/css">
        .ui-jqgrid-bdiv {
            overflow-x: hidden !important;
        }
     </style>
    
    0 讨论(0)
  • 2020-12-13 09:49

    I adjust this type of CSS in my jqgrid

    .ui-jqgrid .ui-jqgrid-bdiv {
     position: relative;
     margin: 0;
     padding: 0;
     overflow: auto;
     text-align: left;
    }
    
    0 讨论(0)
  • 2020-12-13 09:50

    Set an explicit width on the grid and use

    autowidth: false,
    shrinkToFit: true
    
    0 讨论(0)
提交回复
热议问题