jqGrid horizontal scrollbar

前端 未结 13 2091
终归单人心
终归单人心 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:52

    Add the below script to your style.css will resolve your issue.

    .ui-jqgrid .ui-jqgrid-bdiv {
        overflow-x:hidden !important; 
        overflow-y:auto !important;
    }
    
    0 讨论(0)
  • 2020-12-13 09:55

    Here we go width : '1083', shrinkToFit:false,

    When we set the above we need to make sure that our ui.jqgird.css are set as below

    .ui-jqgrid .ui-jqgrid-bdiv { height: auto; margin: 0em; max-height: 250px; overflow-x: auto; overflow-y: auto; padding: 0px; position: relative; text-align: left; }
    
    0 讨论(0)
  • 2020-12-13 09:55

    Here is how I did it and so far, so good. Basically, we resize the grid to accommodate the vertical scroll bar and by resizing, there is no horizontal overflow and therefore, the horizontal bar never shows up. Our cell sizing remains the same and the last cell is not partially hidden.

    loadComplete: function (data) {
                    //set our "ALL" select option to the actual number of found records
                    $(".ui-pg-selbox option[value='ALL']").val(data.records);
                    if ($(".ui-jqgrid").height() > $('#grid').getGridParam('maxHeight')) {
                        //resize our grid for the vertical scroll bar to eliminate the hortizontal scroll bar
                        $(".ui-jqgrid").css("width", $('#grid').getGridParam('width') + 20);
                        $(".ui-jqgrid-bdiv").css("width", $('#grid').getGridParam('width') + 17);
                        $(".ui-jqgrid-hdiv").css("width", $('#grid').getGridParam('width') + 20);
                        $(".ui-jqgrid-view").css("width", $('#grid').getGridParam('width') + 20);
                        $("#pager").css("width", $('#grid').getGridParam('width') + 20);
                        $(".ui-jqgrid-hbox").css("padding-right", "16px");
                    } else { //set everything to defaults
                        $(".ui-jqgrid").css("width", $('#grid').getGridParam('width'));
                        $(".ui-jqgrid-bdiv").css("width", $('#grid').getGridParam('width'));
                        $(".ui-jqgrid-hdiv").css("width", $('#grid').getGridParam('width'));
                        $(".ui-jqgrid-view").css("width", $('#grid').getGridParam('width'));
                        $("#pager").css("width", $('#grid').getGridParam('width'));
                        $(".ui-jqgrid-hbox").css("padding-right", "0px");
                    }
    }
    
    0 讨论(0)
  • Its simple, use in the jqgrid shrinkToFit: false

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

    Apply AppearanceSettings ShrinkToFit="False" and AutoWidth="true" to your jqGrid.

    0 讨论(0)
  • 2020-12-13 10:03

    i adjusted ui.grid.css because i did not need a horizontal scrollbar at all. i did this:

    .ui-jqgrid .ui-jqgrid-bdiv {
      position: relative; 
      margin: 0em; 
      padding:0; 
      /*overflow: auto;*/ 
      overflow-x:hidden; 
      overflow-y:auto; 
      text-align:left;
    }
    

    the commented was how it was, i just used overflow-x to hide the horizontal scrollbar and now all is fine with me.

    0 讨论(0)
提交回复
热议问题