带有角度js的ng网格在页面加载时不会占用100%的宽度.这是我的代码:
<tabs ng-cloak> <pane title="Test Plan"> <tabs> <pane title="Include Tests"> <div ng-controller="includedTestPlanGridCntrl"> <div class="gridStyle" ng-grid="gridOptions"></div> </div> </pane> <pane title="Excluded Tests"> <div ng-controller="excludedTestPlanGridCntrl"> <div class="gridStyle1" ng-grid="gridOptions"></div> </div> </pane> </tabs> </pane> <pane title="Advanced Planning"> Some text here </pane> </tabs>
如果调整大小,网格会正确显示.
这对我有用
$scope.gridOptions = { data: 'gridData',init:function(grid,$scope) { setTimeout(function() { $scope.gridOptions.$gridServices.DomUtilityService.RebuildGrid( $scope.gridOptions.$gridScope,$scope.gridOptions.ngGrid ); },1000); } };
将“gridOptions”替换为您使用的变量和宾果!