The "theory of item renderers" states that all visual aspects of a
renderer should be driven by the renderers data and external calls from
the renderer such as isItemSelected.  No attempts should be made to
manipulate the renderer from the outside because renderers get recycled
(see my blog articles for more info).  I would expect that if you
scrolled, you would find that the check marks end up on the wrong
checkboxes because of recycling.  If the web service updates the
collection, that should cause the renderer to refresh and it should
examine the field in the collection and set its checkmark appropriately.
Then the checkbox renderer can be at any column.  itemToItemRenderer is
there to handle some internal stuff and as a convenience for a few
scenarios where you can get away with using it, but doesn't generalize
well to datagrid because we don't have function overloading.

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: Wednesday, November 21, 2007 6:43 AM
To: [email protected]
Subject: [flexcoders] Re: DataGrid.itemToItemRenderer()- what about
columns besides the first?

 

I don't think so but maybe you can tell me otherwise. I should also
mention that this is mainly a hypothetical question as my current
situation deals with a first column renderer.

My current use of itemToItemRenderer() is to react to data updates
that happen when a web service that is called on an interval returns.
I have a DataGrid whose first column is a CheckBox. The call that is
made on an interval updates the status field of my data items, which
is displayed in another column. When an item is in certain statuses
(various stages of "in progress") I need to disable the CheckBox so
that no further action can be taken on the item. So currently I am
catching the CollectionEvent, finding the affected items and then
using itemToItemRenderer() to access and disable/enable the CheckBox.
If the CheckBox were not in the first column, or I needed to update
some other field, how would I go about that? Or would I just kinda be
SOL?

Thanks,
Ben

--- In [email protected] <mailto:flexcoders%40yahoogroups.com>
, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> No public API. There are mx_internal ways, but is there no way for you
> to work from events and the renderers?
> 
> 
> 
> ________________________________
> 
> From: [email protected] <mailto:flexcoders%40yahoogroups.com>
[mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of ben.clinkinbeard
> Sent: Tuesday, November 20, 2007 8:19 PM
> To: [email protected] <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] DataGrid.itemToItemRenderer()- what about
columns
> besides the first?
> 
> 
> 
> Title pretty much sums it up, but what if I wanted to access an
> itemRenderer that is not in the first column? Is there any way to do
> that starting with nothing but the corresponding data item?
> 
> Thanks,
> Ben
>

 

Reply via email to