简体   繁体   English

flex datagrid itemRenderer的高度?

[英]flex datagrid itemRenderer height?

I have a datagrid column that I am using an itemRenderer. 我有一个datagrid列,我正在使用itemRenderer。 Something like this 像这样

<mx:itemRenderer>
    <mx:Component>
        <mx:HBox width="100%" verticalAlign="middle" horizontalGap="0" horizontalScrollPolicy="off" height="22">
            ...
        </mx:HBox>
    </mx:Component>
</mx:itemRenderer>

The row heights are fine if the datagrid has any entities. 如果数据网格具有任何实体,则行高很好。 However if there are not entries the rows height is no longer 22. Is there anyway to fix this? 但是,如果没有条目,则行的高度不再是22。是否可以解决此问题?

(I have two datagrids beside each other. One is always populated so it has the right height. It looks really bad when the second one is not populated and the rows do not align). (我彼此之间有两个数据网格。总是填充一个数据网格,所以它具有正确的高度。当不填充第二个数据网格并且行未对齐时,这看起来真的很糟糕)。

Set the rowHeight property of your DataGrid to 22 (or whatever value you prefer). 将您的DataGridrowHeight属性设置为22(或您喜欢的任何值)。 Then just set the height of the HBox in the itemRenderer to 100%. 然后只需将itemRenderer HBox的高度设置为100%。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM