There is an example in the doc for this
situation:
Stephen From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Kumar Sent: Monday, September 11, 2006 2:44 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] validators in datagrid colmun
Hi All
Below is the simple data grid I want to apply some like numeric validators on some particular column of data grid. Is there any example for this..
!
<?xml version="1.0"?> <mx:Application xmlns:mx="http://www.adobe. <mx:Script> <![CDATA[ &n!
bsp; import mx.controls. import mx.events.DataGridE
[Bindable] public var initDG:Array = [ {Artist:'Pavement'
]; // Define event listener for the itemEditEnd event. private function getCellInfo(
// Get the item editor and cast it to TextInput. var myEditor:TextInput = TextInput(event. &!
nbsp; // Get the new value from the editor. var newVal:String = myEditor.text; // Get the old value. &n!
bsp; &nb!
sp;
; var oldVal:String = event.currentTarget // Write out the cell coordinates, new value, // and old value to the TextArea control. cellInfo.text = "cell edited.\n"; cellInfo.text += "Row, column: " + event.rowIndex + ", " + event.columnIndex + "\n"; cellInfo.text += "New value: " + newVal + "\n"; cellInfo.text += "Old value: " + oldVal; } !
; !
&n
bsp; ]]> </mx:Script>
<mx:TextArea id="cellInfo" width="300" height="150&q!
uot;/> <mx:DataGrid id="myGrid" dataProvider="{initDG}" editable="true" itemEditEnd="getCellInfo( <mx:columns> <mx:DataGridColumn dataField="Artist" /> <mx:DataGridColumn!
dataField="Album"/>
<mx:DataGridColumn dataField="Price"/> </mx:columns> </mx:DataGrid> </mx:Application>
Thanks KP -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |