Turnoff Scrolling within Angular UI ng-grid?

后端 未结 4 2113
再見小時候
再見小時候 2020-12-29 11:13

We would like to use the Angular UI ng-grid, but can\'t seem to find an option to tell the viewport within the grid to not set the overflow to auto and not scroll.

W

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-29 11:52

    In your CSS, you can try overriding the height of the div containing the rows, so the rows don't overflow the container:

    .ngViewport {
      height: auto !important;
    }
    

    You can also fill in the white space that ng-grid leaves for the scrollbar with the row background colour (although unfortunately the data last cell won't expand to fill the gap):

    .ngCanvas {
       width: 100% !important;
    }
    .ngRow {
       width: 100% !important;
    }
    

    Depending on your table layout you might need to change some other styles too, but these are the main ones. Also take care not to set a height for the entire ngGrid.

提交回复
热议问题