I have an editable datagrid with data being populated from an
XMLListCollection. I am attempting to edit the data in one of the
columns that is using a labelFunction to get its value. This column does
not have a dataField value. How can I edit the data in the field and
have the XMLListCollection reflect the updated change correctly as well
as have the field value change? As it stands now I can change the data
in the column, however once I leave that datafield it reverts back to
the original value and the XMLListCollection remains unchanged.

Here is the DG code:

     <mx:DataGrid id="buildingNumber_dg" editable="true"
dataProvider="{building_xmlcoll}" >
         <mx:columns>
             <mx:DataGridColumn headerText="Building Number"
labelFunction="getValue" editable="true" />
         </mx:columns>
     </mx:DataGrid>
<mx:Script>
         <![CDATA[
             private function
getValue(item:Object,grid:DataGridColumn):String {

                 return item.toString();
             }
         ]]>
     </mx:Script>

XML CODE:
<properties>
         <building>Office</building>
         <building>Lunch</building>
         <building>333</building>
         <building>404</building>
</properties>

Thanks.

Reply via email to