Skip to content

Instantly share code, notes, and snippets.

@rjattrill
Last active December 10, 2015 13:29
Show Gist options
  • Save rjattrill/4441178 to your computer and use it in GitHub Desktop.
Save rjattrill/4441178 to your computer and use it in GitHub Desktop.
Format and align numbers in a Spark DataGrid
<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>
@rjattrill
Copy link
Author

This is not the easiest way. Use labelFunction on the GridColumn. See other Gist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment