UI-GRID-动态行高-替代 [英] UI-GRID - Dynamic Row Height - Alternatives

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

问题描述

我试图获得一个可以动态扩展其高度的单元格.

I tried to get a cell to expand it's height dynamically.

是否可以在渲染行后调整其行的高度?

如果没有,那么我将尝试在网格中使用可扩展网格或树.

If not, then I will try to use an expandable grid or tree in a grid.

是否可以在特定的单元格/列上显示可扩展的网格?

目前,我看到所有可扩展网格/树网格占据了父级下的整行.

Currently I see all expandable grids/tree grids that take up the entire row below the parent.

谢谢

推荐答案

您可以在此处看到相同问题的答案:

You can see an answer to the same question here: https://github.com/angular-ui/ng-grid/issues/3239#issuecomment-91045267

UI-Grid虚拟化了行,这意味着它仅呈现数据的一小部分,并保留了视图中不会显示的所有内容.这意味着网格需要知道每行的高度,以便可以计算位置.

UI-Grid virtualizes the rows, meaning that it only renders a small subset of the data, and leaves everything that wouldn't be in view unrendered. This means the grid needs to know how tall every row is, so that it can calculate positioning.

如果必须在渲染时测量每一行,这将导致浏览器一遍又一遍地重新绘制,并且性能会很糟糕.

If it had to measure every row when rendered this would cause the browser to repaint over and over and performance would be miserable.

您会发现其他虚拟化工具(例如Ionic的collection-repeat)具有相同的局限性.

You'll find that other virtualized tools (like Ionic's collection-repeat) have the same limitation.

更新:

要回答第二个问题:您可以在GridRow对象(不是您的实体)上设置height属性,可以使用

To answer your second question: you can set a height property on the GridRow object (not your entity, you can use getRow from the grid API to get the GridRow object) and the grid will use this height when rendering the row.

您的第三个问题:不,可扩展仅用于处理整个行.可能可以根据某些单元格中的点击来更改子网格中显示的数据类型,但这需要对可扩展代码进行一些更改.

And your third question: no, expandable is only built to work off entire rows. It might be possible to alter what sort of data is displayed in a sub-grid based on clicks in certain cells, but that would require some changes to the expandable code.

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

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