Are you using editField() to update the dataProvider in the “//TODO:” section?

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, July 07, 2005 12:29 PM
To: flexcoders@yahoogroups.com
Subject: RE: [flexcoders] How do I bound XML data into an array that is my dataprovider for a data grid

 


Thanks that works great, but if  select something from the combobox and then try to sort the column that the combobox is in, it does not sort with the rest of the row.
How do I set that value?  Thanks




CONFIDENTIALITY STATEMENT - This message and any files or text attached to it are intended only for the recipients named above, and contain information that may be confidential or privileged.  If you are not an intended recipient, you must not read, copy, use, or disclose this communication.  Please also notify the sender by replying to this message, and then delete all copies of it from your system.  Thank you.


"Abdul Qabiz" <[EMAIL PROTECTED]>
Sent by: flexcoders@yahoogroups.com

07/07/2005 12:54 AM

Please respond to
flexcoders@yahoogroups.com

To

<flexcoders@yahoogroups.com>

cc

 

Subject

RE: [flexcoders] How do I bound XML data into an array that is my data provider for a data grid

 

 

 




Hi,

Look at the following code:



##employeesModelTest.mxml##

<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
initialize="onAppInit()">
   <mx:Script>
       import ComboBoxCellRenderer;
       
       function onAppInit()
       {
           ComboBoxCellRenderer.dataProvider = ["San Francisco",
"Bangalore","Newton"];
        }
       
   
   </mx:Script>
   <mx:Model id="employeesModel" source="employees.xml"/>
   <mx:DataGrid dataProvider="{employeesModel.employee}" width="500">
       <mx:columns>
           <mx:Array>
               <mx:DataGridColumn columnName="id"></mx:DataGridColumn>
               <mx:DataGridColumn
columnName="name"></mx:DataGridColumn>
               <mx:DataGridColumn columnName="location"
cellRenderer="{ComboBoxCellRenderer}"></mx:DataGridColumn>
           </mx:Array>
       </mx:columns>
   
   </mx:DataGrid>

</mx:Application>


##ComboBoxCellRenderer.mxml##

<mx:HBox xmlns:mx="http://www.macromedia.com/2003/mxml">
   <mx:Script>
       public static var dataProvider:Array;
       private var listOwner:Object;
       
                //TODO: all required code to make this renderer complete.
       
       
   </mx:Script>
   <mx:ComboBox id="_cb"
dataProvider="{ComboBoxCellRenderer.dataProvider}" change=""/>
</mx:HBox>



##employees.xml##
<employees>
                <employee>
                                 <id>1</id>
                                 <name>Matt</name>
                                 <location>San Francisco</location>
                </employee>
                <employee>
                                 <id>2</id>
                                 <name>Gary</name>
                                 <location>San Francisco</location>
                </employee>
</employees>


That is how you bind a Model with DataGrid. As far as ComboBox's
dataProvider is concerned, you can have static property in CellRenderer
class. Set the static property from the application.

-abdul
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On
Behalf Of Joe
Sent: Thursday, July 07, 2005 3:00 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How do I bound XML data into an array that is my
data provider for a data grid

I am using an array to provide a data provider for my data grid that
has a cellrendering colum that produces a combobox.
With in the array is a New Array for the combo box data provider. It is
OK that the values for the combo box are hard coded, but I twant he
rest of the values tin the data grid to come from a Model which source
is a XML file. How can I bound the values from the XML source to my
array.




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
   [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com




YAHOO! GROUPS LINKS




Reply via email to