Yes that example in that other reply will show you how to do this, but I
want to make a key idea very clear.

 

When working with data, one never (almost) "loops over the DataGrid".
One always works with the underlying dataProvider.  This is because Flex
only creates the visible rows.  When you scroll, or change the data, the
data from the underlying dataProvider item is assigned to the
itemRenderer, and the renderer must use that data to update its UI.

 

In your case, the itemRender must set the CheckBox.selected property
from a value in the dataProvider item.

 

Google "Harui itemRenderer" to find a full discussion and many examples.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of p_repetti
Sent: Friday, March 21, 2008 7:16 AM
To: [email protected]
Subject: [flexcoders] Select all checkboxes in datagrid with a single
click

 


Hello

I have created a DataGrid component whose last column is rendered/edited
with a checkbox. This checks whether the row data will be sent to the
server
or not.
Rather than forcing the user to check all of the rows manually, I have a
"Select All" button which commands the selection of all the checkboxes
in
that column. 
My problem is that I can't write the code to implement the selection. It
is
AS code most likely, but I could not find an example going through
docs/forums/whatever.
How do I loop over the DataGridColumn object to get the CheckBox
instances ?

Can anyone point me to useful examples/references ?

Thanks
-- 
View this message in context:
http://www.nabble.com/Select-all-checkboxes-in-datagrid-with-a-single-cl
ick-tp16196734p16196734.html
<http://www.nabble.com/Select-all-checkboxes-in-datagrid-with-a-single-c
lick-tp16196734p16196734.html> 
Sent from the FlexCoders mailing list archive at Nabble.com.

 

Reply via email to