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" <[EMAIL PROTECTED]> 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 >