AngularJS UI网格行未根据内容调整大小 [英] Angularjs ui-grid row not resizing according to content

查看:59
本文介绍了AngularJS UI网格行未根据内容调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ui-grid(v3.0.0-rc.20-8199eb5)cellTemplate,它遍历数组并在列中打印出名称.

I have a ui-grid(v3.0.0-rc.20-8199eb5) cellTemplate which iterates over an array and prints out the names in the column.

{name:'roles', cellTemplate: '<div ng-repeat="role in row.entity.roles>{{role.name}}</div>'}

行高不足以容纳内容并切断内容. 每个条目的行高会有所不同,具体取决于条目的角色数量.

The row height is not big enough for the content and cuts it off. Row height will differ per entry depending on the amount of roles for the entry.

有没有一种方法可以使整个行根据行中的内容自动扩展/调整大小?

Is there a way for the entire row to auto expand/resize according to the content in the row?

推荐答案

最终对我有用的解决方案是为ui-grid编辑CSS.

The solution that worked for me in the end was editing the css for the ui-grid.

.ui-grid-cell { display : table-cell; height: auto !important; overflow:visible; position: static; padding-top: 10px; } 
.ui-grid-row { display : table-row; height: auto !important; position: static; } 
.ui-grid-cell-contents{ height: auto !important; white-space: normal; overflow:visible; } 

这篇关于AngularJS UI网格行未根据内容调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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