Angularjs ui-grid 行不根据内容调整大小 [英] Angularjs ui-grid row not resizing according to content

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

问题描述

我有一个 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-grid 行不根据内容调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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