|
Ok, here we go. It’s a little bit of a trial and
error fiddle, but this custom DataGridColum will actually accept an additional
DataProvider, call an inline itemEditor, select the current datagrid cell value
in the combobox upon creation, and return any desired data after a
combobox selection change. Hope it helps someone... -Iko <?xml
version="1.0" encoding="utf-8"?> <mx:DataGridColumn
xmlns:mx="http://www.adobe.com/2006/mxml"
editorDataField="selectTest"> <!--
Extended Properties of DataGridColumn --> <mx:ArrayCollection
id="dataProviderEdit"></mx:ArrayCollection> <!-- Dataprovider for combobox itemEditor --> <mx:String id="returnField"></mx:String> <!-- Name of the data field that the combobox returns --> <mx:String id="labelFieldCombo"></mx:String> <!-- Name of the labelField for the combobox --> <mx:itemEditor> <mx:Component> <mx:ComboBox
dataProvider="{outerDocument.dataProviderEdit}" labelField="{outerDocument.labelFieldCombo}"
creationComplete="selectThis()" >
<mx:Script> <![CDATA[ private
function selectThis():void { var
index:int = -1; for(var
i:int=0;i<this.dataProvider.length;i++) { if(this.dataProvider[i][labelField] == parentDocument.dataProvider[parentDocument.selectedIndex][outerDocument.dataField]) { index
= i; break; } } this.selectedIndex
= (index == -1) ? 0 : index; } public
function get selectTest():String { return
this.selectedItem [outerDocument.returnField]; } ]]> </mx:Script>
</mx:ComboBox> </mx:Component> </mx:itemEditor> </mx:DataGridColumn> From: I think it should be possible to write an MXML component based on
<mx:DataGridColumn>, although I've never tried it. - Gordon From:
-- 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 __,_._,___ |

