开发者

Text align in datagrid

How to place two different texts( using html tags ) in column in a datagrid , in which one will be right aligned and the other will be left aligned.开发者_StackOverflow社区


Create a custom itemRenderer for the column in question. Here is an article on itemRenderers.


To go along with Flextras answer, here's a quick example:

<mx:DataGrid dataProvider="{myArrayCollection}">
    <mx:columns>
        <mx:DataGridColumn headerText="Title" dataField="title">
            <mx:itemRenderer>
                <mx:Component>
                    <mx:VBox paddingLeft="2" width="100%">
                        <mx:Label text="{myDataField1}" width="100%" />
                        <mx:Label text="{myDataField2}" textAlign="right" width="100%" />
                    </mx:VBox>
                </mx:Component>
            </mx:itemRenderer>
        </mx:DataGridColumn>
    </mx:columns>
</mx:DataGrid>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜