Last active
December 10, 2015 13:29
-
-
Save rjattrill/4441178 to your computer and use it in GitHub Desktop.
Format and align numbers in a Spark DataGrid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<s:GridColumn dataField="valueNum" headerText="Default Value" width="100"> | |
<s:itemRenderer> | |
<fx:Component> | |
<s:GridItemRenderer> | |
<fx:Declarations> | |
<s:NumberFormatter id="numberFormatter"/> | |
</fx:Declarations> | |
<s:layout> | |
<s:HorizontalLayout horizontalAlign="right" verticalAlign="middle"/> | |
</s:layout> | |
<s:Label text="{numberFormatter.format(data.valueNum)}" /> | |
</s:GridItemRenderer> | |
</fx:Component> | |
</s:itemRenderer> | |
</s:GridColumn> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is not the easiest way. Use labelFunction on the GridColumn. See other Gist.