Not at all trivial, and most Flex developers hit this strubling block
sooner or later.

 

When working with Flex list based components, you MUST work with the
dataProvider.  You cannot access data through the visual control, as you
can with some environments.

 

Exactly how you access the data depends on the type of dataProvider.
Each type has an associated API, and you need to use this API to access
the data.  For example ArrayCollection has getItemAt(iIndex), so you
could do:

myCellValue = myDataGrid.dataProvider.getItemAt(0).myPropertyName;

 

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Nick
Sent: Thursday, June 14, 2007 5:12 PM
To: [email protected]
Subject: [flexcoders] Reading Data from an editiable Datagrid.

 

Hello all! 

I have a DataGrid that I have associated (dataProvider) to a blank
array that has been initialized as a collection of 5 objects with each
object having 3 member variables. I have made my DataGrid editable and
now have the ability to enter data into the 5 rows. I would now like
to simply read this data back into my array for processing after the
user has finished filling in the data. For some reason I am having a
major block on how to accomplish this. 

I would love to just say something like: 

myData = myDataGrid.data 
trace(myData[0].col1Name) //traces the first row, first column data. 

but that does not seem to be working for me. 

Any clues? I have a feeling I am missing something trivial here. :) 

Thanks. 

Nick 

 

Reply via email to