![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
Hi,
I'm new in Flex, I need to add number validations to my ItemRenderer in the DataGridColumn <mx ataGridColumn dataField="value" itemRenderer="mx.controls.TextInput"headerText="Header" /> Can someone point me to a good example, please? I appreciate your help.. Text |
| Sponsored Links |
|
|||
|
Use a labelFunction:
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <![CDATA[ import mx.events.DataGridEvent; import mx.collections.*; private var myDPColl:ArrayCollection; [Bindable] private var myDP:ArrayCollection = new ArrayCollection([ {Album:'Slanted and Enchanted', Price:11.99}, {Album:'Crooked Rain, Crooked Rain', Price:10.99}, {Album:'Wowee Zowee', Price:12.99} ]); private function priceLabelFunction(item:Object, column ataGridColumn):String{return nmbFormatter.format(item.Price); } ]]> </mx:Script> <mx:NumberFormatter id="nmbFormatter" precision="2" rounding="up" decimalSeparatorTo="*"/> <mx ataGrid dataProvider="{myDP}" id="myGrid" width="100%"><mx:columns> <mx ataGridColumn minWidth="200" dataField="Album" /><mx ataGridColumn width="75" dataField="Price"labelFunction="priceLabelFunction"/> </mx:columns> </mx ataGrid></mx:Application> |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise