角UI NG-网格内关断滚动? [英] Turnoff Scrolling within Angular UI ng-grid?

查看:158
本文介绍了角UI NG-网格内关断滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们想用角UI NG-电网,但似乎无法找到一个选项,告诉网格内的视口未设置溢出汽车,而不是滚动。

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.

我们想要做的是有基础了我们的网格行数的大小,表/格的高度是动态的。我们行的固定的最大数量所以在DOM中有太多的行很少关注。

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?

推荐答案

最近,我遇到了同样的问题,并找到解决方案在https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY

I recently ran into same issues and found a solution at https://groups.google.com/forum/#!topic/angular/KiBXP3eKCDY

您想 NG-格来初始化你的数据了。

You want ng-grid to initialize after you have data.

下面的解决方案需要采用了棱角分明的UI:

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"
   };
};

这篇关于角UI NG-网格内关断滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆