grid height and the empty space after the last col

2019-03-05 13:56发布

问题:

Is it possible to comply all these requirements ?

  • the height of the grid shall be fixed whatever the number of records;
  • the right space after the last columns shall be never displayed;
  • if the number of records is greater than the height of the grid then a vertical scrollbar shall be displayed;
  • an horizontal scrollbar shall be never displayed;
  • when possible, the height could be adapted in order to not have an "half" displayed record in the bottom of the grid.
  • with scroll = true

... and whatever the number of grids on screen OUF !

PS: Oleg has surely the answer ...

回答1:

Add this to your stylesheet:

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

As parameters to jqgrid add:

 scrollOffset: 0,


标签: jqgrid