Turnoff Scrolling within Angular UI ng-grid?
angular-ui, angularjs, ng-grid
Solution
I recently ran into same issues and found a solution at https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY
You want `ng-grid` to initialize after you have data.
The following solution requires using angular-ui:
<div ui-if="dataForGrid.length>0" ng-grid="gridOptions" ng-style="getTableStyle()" />
$scope.getTableStyle= function() {
var rowHeight=30;
var headerHeight=45;
return {
height: ($scope.dataForGrid.length * rowHeight + headerHeight) + "px"
};
};
Problem
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. What we'd like to do is have the table/grid height be dynamic based off the size of the number of rows in our grid. We have a fixed max number of rows so there is little concern with having too many rows in the DOM. Any suggestions on where to go?