You could simply use listOwner.editField inside the cell renderer. For
example something like:
<mx:CheckBox click="this.clickCheckBox( event )"/>
function clickCheckBox ()
{
listOwner.editField( getCellIndex().itemIndex,
"My_Date_Column_Name_To_Update", Date() )
}
Thus when a user clicked the checkbox, listOwner.editField will update the
dataProvider and the date displayed in the dataGrid.
Hope this helps,
Malcolm
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of fowleryj
Sent: Friday, 11 November 2005 8:46 AM
To: [email protected]
Subject: [flexcoders] Recognizing when a CheckBox inside a DataGrid is
clicked
[env: Flex 1.5 with Cairngorm architecture]
I am using the CheckBoxCellRenderer provided by Peter Ent via this
download:
http://www.markme.com/pent/archives/flex/solutions/cellrenderers.zip
I have my program working such that when a user clicks the Save button
in my mxml file, all the rows whose CheckBoxes are checked are stored
in a new Array by a save() function in the mxml's ViewHelper.
What I would like to do now is update the text in one of the cells
when the CheckBox is clicked. To be more specific, each row in the
DataGrid has a "date" column, and when the row's CheckBox is clicked,
I'd like the current date to replace the date displayed in that row's
"date" column.
However, I can't figure out how to get the CheckBox to realize it has
been clicked so that I can call the updateDate() function in the
mxml's ViewHelper. I tried modifying the code in the
CheckBoxCellRenderer class, but from there, I couldn't find an easy
way to access the mxml's DataGrid and its dataProvider. I tried using
the "change" property of the DataGrid, but that only recognizes that a
row has been selected, not that a CheckBox has been clicked.
[As an aside, I noticed while I was modifying the CheckBoxCellRenderer
that the setValue() function is called twice everytime the mouse
passes over a DataGrid row containing a checked CheckBox(es). This
seemed odd.]
Thanks in advance!
--
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
------------------------ Yahoo! Groups Sponsor --------------------~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
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/