Tracy,

Is it because creationComplete only happens once per visible row and the
renderer is recycled on dg scroll, change, etc?

What I desperately want to learn is how to know when to override a
super's function - in this case updateDisplayList(). How would you know
to do that verses invalidateList() or  invalidateDisplayList()??

Is this learned by experience (such as how I am right now), or does one
look at this code and intuitively know to override updateDisplayList?
Does it become more apparent when you start disecting inherited classes?
How is this learned?

BTW, your input helped me arrive at a very elegant solution with native
mxml - AdvancedDataGridRendererProvider:

<mx:AdvancedDataGrid ... >
<mx:columns>
<mx:AdvancedDataGridColumn headerText="Archive" dataField="@archived" 
width="50" id="archived_col" />
<mx:AdvancedDataGridColumn ... />
</mx:columns>
<mx:rendererProviders>
<mx:AdvancedDataGridRendererProvider column="{archiveed_col}"
     depth="2" renderer="renderers.CheckBoxItemRendererProvider"/>
</mx:rendererProviders>
</mx:AdvancedDataGrid>

The depth is the key - where 1 would be the Group node and 2 would be
the first indentation or sub-set of data under the grouping.

Even though I found a solution, I am still very interested in your
thoughts on the learning approach query above.

Thanks to all,

Jeff






--- In flexcoders@yahoogroups.com, "Tracy Spratt" <[EMAIL PROTECTED]> wrote:
>
> And remove that logic from the creationComplete handler entirely.  Do
> you understand why?
>
> Tracy
>
>
>
> ________________________________
>
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]
On
> Behalf Of gene_belor
> Sent: Tuesday, June 10, 2008 10:58 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: AdvancedDataGrid ItemRenderer
>
>
>
> override updateDisplayList(..) function and set visibility there as
> opposed to in set data(...).
>
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>
> , "securenetfreedom" nv1000@ wrote:
> >
> > I am using an ADG with HierarchicalData to group my data. I am using
a
> > checkbox item renderer that the user can check to archive the row.
> > However, the checkbox is diplaying on every row and I need it to
> > display only on the sub-set like below:
> >
> > Group | Archive | Title |
> > Group1
> > ------|-- chk --| Trains |
> > ------|-- chk --| Planes |
> > Group2
> > ------|-- chk --| Autos |
> >
> > I have tried setting the visibility of the Canvas (the base of the
> > checkbox itemrenderer component) in the creationComplete handler and
> > in the 'set data' method of the component which works on the first
> > pass, but when scrolling the grid or expanding the nodes, results
are
> > inconsistent.
> >
> > private var _vis:Boolean;
> > // called by creationComplete event
> > public function init():void{
> > var nodeName:String = _listData["item"].name();
> > _vis = (nodeName == "item");
> > this.visible = _vis;
> > }
> > override public function set data(value:Object):void {
> > super.data = value;
> > chkbox.selected = (value[_dataField] == "true");
> > this.visible = _vis;
> > }
> >
> > Thanks for your input.
> >
> > Jeff
> >
>

Reply via email to