RE: [flexcoders] Re: Issue with item renderer in Flex 3

2010-07-23 Thread Gregor Kiddie
If you are doing a lot of this, there is a decent approach but it's very
long winded...

 

Override your DG so that when you add to the dataprovider (or when items
are added to the DP) the objects in the DP get wrapped in a DGAware
object. This object provides access to the wrapped object and exposes
the relevant fields for checkboxes (isEditedYellow, isEditedBlue, etc).

 

This keeps your underlying data object ignorant of any renderer related
fields, and still allows you to set up the state of the renderer in set
data.

 

This is a fair bit of work mind...



Re: [flexcoders] Re: Issue with item renderer in Flex 3

2010-07-23 Thread Alex Harui
The color of the checkbox must be associated with the data either by adding a 
property to the data or by comparing the data to see if it is in the 
selectedItems (if you used the checkbox dg example from my blog) or by using a 
Dictionary or some other map.

If you are having problems after doing that, then you are not properly 
resetting the color if the data association does not require the color to be 
yellow


On 7/23/10 6:04 AM, shameer.forflex shameer.forf...@yahoo.com wrote:






I tried even this. The problem is that I am using the same checkbox renderer in 
multiple columns. So if I use isEdited with the data(data.isEdited), when you 
check one checkbox in one column, color of the checkbox in other columns also 
changes to yellow. Also I didn't want to associate isEdited to the data, since 
I thought there would be a better approach.

Thanks
Shameer

--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , 
Gregor Kiddie gregor.kid...@... wrote:

 Add the isEdited variable to your data item and inside set data(...) do



 If (data.isEdited) {

 ...

 }



 Instead.







--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui