Joe.
Part
of the Custom Cell Render Spec are four attributes that are available to the
Cell Renderer. They are:
owner
- the row the cell renderer instance is in.
listOwner - the container (data grid, list box, etc) the row is
in
getDataLabel - function that will give you the column name the cell
renderer is mapped to
getCellIndex - function that returns an object/structure/hash map of
itemIndex (row), column index (pos in column array) and one other piece which I
forget.
So,
using this (they must be declared and are case sensitive to the spelling above)
you can either dynamically get to the value of the current cell or static get to
the value of a cell in that row. Here are some examples assuming you are mapping
to the clickEvent of the checkbox that is in your cell
renderer.
function onValueChanged() :
Void
{
var item = this.listOwner.dataProvider[getCellIndex().itemIndex];
item[this.getDataLabel()] = checkbox.selected;
}
{
var item = this.listOwner.dataProvider[getCellIndex().itemIndex];
item[this.getDataLabel()] = checkbox.selected;
}
or
function onValueChanged() :
Void
{
var item = this.listOwner.dataProvider[getCellIndex().itemIndex];
item['myGoofyColumn'] = checkbox.selected;
}
{
var item = this.listOwner.dataProvider[getCellIndex().itemIndex];
item['myGoofyColumn'] = checkbox.selected;
}
Best.
Ben
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, June 23, 2005 1:25 PM
To: [email protected]
Subject: Re: [flexcoders] Re: Data grid with check box... How to get value
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED]
Sent: Thursday, June 23, 2005 1:25 PM
To: [email protected]
Subject: Re: [flexcoders] Re: Data grid with check box... How to get value
The data grid is populated from a data provider. It displays about 20 rows.
When I click on one of the check box I would like to be able to get a value from one of the cells in that row.
The data grid is a MXML component and the check box is from a cell rendering action scripting file.
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.
--
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
- 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 the Yahoo! Terms of Service.

