Angular ng-grid 行高 [英] Angular ng-grid row height

查看:31
本文介绍了Angular ng-grid 行高的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法可以根据其内容在 ng-grid 中应用行的高度.有一个选项 rowHeight 可以更改所有行的高度.但我想要根据其内容动态行高.

is there any way to apply the height of the row in ng-grid according to its content. there is one option rowHeight which is changed the height of all row. But I want dynamic row height according to its content.

以下是我制作的Plunker,在这个我使用cellTemplate插入Education字段,但我想根据education字段细节增加行高.

Following is the Plunker I have made, in this I have used cellTemplate to insert Education field, But I want to increase the row height according to education field detail.

http://plnkr.co/edit/tQJNpB?p=preview

根据此链接,这是不可能的:[1]https://github.com/angular-ui/ng-grid/issues/157

According to this link it is not possible: [1]https://github.com/angular-ui/ng-grid/issues/157

但是如果有人找到解决方案.....

But if anyone find the solution.....

推荐答案

这些类将使表格充当实际表格,使用显示表格行和表格单元格.

These classes will make the table act as actual table, using display table-row and table-cell.

.ngCell  {
  display : table-cell;
  height: auto !important;
  overflow:visible;
  position: static;
}

.ngRow {
  display : table-row;
  height: auto !important;
  position: static;
}

.ngCellText{
  height: auto !important;
  white-space: normal;
  overflow:visible;
}

请注意,IE8 及更高版本支持此功能.它还覆盖了整个 ng 网格类,因此在需要"基础上使用是明智的:

Please note that this is supported by IE8 and up. It's also overriding the entire ng grid classes so it will be wise to use on a "need to" base:

#myTableId .ngCell {...}
#myTableId .ngRow {...}
...

这篇关于Angular ng-grid 行高的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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