Spark DataGrid多行标题渲染器

时间:2013-05-16 13:00:08

标签: flex4 flex-spark flex-datagrid

我有一个数据网格,其中一个列有一个长标题文本,所以我想跨越多行。我尝试了几件事但无济于事。这是我目前的代码:

<s:GridColumn rendererIsEditable="true" sortable="false">
                <s:headerRenderer>
                    <fx:Component>
                        <s:GridItemRenderer>
                            <s:layout><s:HorizontalLayout horizontalAlign="center"/></s:layout>
                            <s:Label fontWeight="bold" text="Allow Spillover" verticalAlign="middle" maxDisplayedLines="2"
                                toolTip="Allow campaign spillover if the impression goal was not reached by the defined end date. Enabled only if a Periodic or Total Impressions were defined in the ‘General Capping’ section. Maximum Spillover is until next configured flight date."/>
                        </s:GridItemRenderer>
                    </fx:Component>
                </s:headerRenderer>

可以看出,我将maxDisplayedLines设置为2,但文本仍然没有中断,但溢出了列之外。我错过了什么?感谢。

1 个答案:

答案 0 :(得分:1)

点击此链接获取答案

How to center a header renderer in a Spark data grid?

只需更改标题渲染器maxDisplayedLines中的Label

即可