I attacked this problem by focusing on keeping all the check-boxes correctly selected during a wild scroll up or down. Here's <a href="http://home.comcast.net/~max.nachlinger/dgCheckboxScroll/">my solution</a>, I hope it helps.
--Max --- In [email protected], Simon Bailey <[EMAIL PROTECTED]> wrote: > > Fair enough, thanks for the feedback :) > > On 24 Nov 2008, at 15:49, Alex Harui wrote: > > > > > The code you posted just sets visible=true/false which would likely > > set the entire renderer to visible/invisible and not some checkbox > > inside. If the code you showed is for a subclassed checkbox inside > > the renderer, then I'd make sure the .data is passed from the > > renderer to the subclassed checkbox. > > > > > > > > In cases like these, I usually extend DataGrid and add a function > > that dumps out the state of the renderers and their data items. > > Scroll until it goes bad, hit the button, call the function in the > > DG and see what it thinks is going on. > > > > > > > > -Alex > > > > > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > > On Behalf Of Simon Bailey > > Sent: Sunday, November 23, 2008 11:44 PM > > To: [email protected] > > Subject: Re: [flexcoders] DataGrid itemRenderer Woes > > > > > > > > Just a checkbox inside of it in answer to your first question. > > > > > > > > The reason I am using a column to ascertain visibility of the check > > box is due to using a vo to populate the header renderer and I need > > to make a comparison between the grid renderer current item and it > > corresponding column header vo. > > > > > > > > Cheers, > > > > > > > > Si > > > > > > > > On 24 Nov 2008, at 06:33, Alex Harui wrote: > > > > > > > > > > > > > > Are you changing the visibility of the entire renderer or just a > > checkbox inside it? Renderers on the recycle list get visible=false > > and set back to true when used again. If you completely hide a > > renderer, I'm not sure what would happen. > > > > > > > > Other than that, I would find a way to introspect the renderers and > > see if they did compute visible correctly for their data. It seems > > odd that your lookup of data.val is based on a column. > > > > > > > > From: [email protected] [mailto:[EMAIL PROTECTED] > > On Behalf Of Simon Bailey > > Sent: Sunday, November 23, 2008 11:24 AM > > To: [email protected] > > Subject: Re: [flexcoders] DataGrid itemRenderer Woes > > > > > > > > Ok I have stopped all the errors and essentially integrated your > > (Alex's) logic into my application after some serious hair pulling. > > > > > > > > The responsibility lies now with the method below for showing or > > hiding the check box: > > > > > > > > override protected function commitProperties():void > > > > { > > > > super.commitProperties(); > > > > var row:int = listData.rowIndex+1; > > > > visible = false; > > > > for( var i:int = 0; i < data.ff.length; i++ ) > > > > { > > > > if( data.val[listData.columnIndex-1] != > > undefined && data.val[listData.columnIndex-1].option[i] == row ) > > > > { > > > > visible = true; > > > > } > > > > } > > > > if (owner is ListBase) > > > > selected = > > ListBase(owner).isItemSelected(data); > > > > } > > > > > > > > And dammit if its still doing exactly the same as before?!? > > > > > > > > On 23 Nov 2008, at 04:48, Alex Harui wrote: > > > > > > > > > > > > > > > > Read the item renderers section on my blog (blogs.adobe.com/ > > aharui). Start with the oldest posting. > > > > > > > > From: < /span>[email protected] [mailto:[email protected] > > ] On Behalf Of Simon Bailey > > Sent: Saturday, November 22, 2008 2:37 PM > > To: [email protected] > > Subject: [flexcoders] DataGrid itemRenderer Woes > > > > > > > > Hi, > > > > I have seen through google that this has been an issue but > > implementing various solutions still l! eaves my existing problem. > > > > Essentially I have a DataGrid with a custom itemRenderer displaying > > CheckBoxes. > > Within the renderer I am running a comparison on a value within the > > renderers data i.e. data.my_val and the current grid row and column > > values. > > Depending on whether the data value equals a specific row I show or > > hide the check box. > > I achieve this by running the comparison logic with the overridden > > updateDisplayList method below which works fine until scrolled. > > > > override protected function updateDisplayList( unscaledWidth:Number, > > unscaledHeight:Number ):void > > { > > super.updateDisplayList( unscaledWidth, unscaledHeight ); > > var row:int = listData.rowIndex+1; > > > > for( var! i:int = 0; i < data.ff.length; i++ ) > > { > > if( data.val[listData.columnIndex-1] != undefined && > > data.val[listData.columnIndex-1].option[i] == row ) > > { > > btn.visible = true; > > } > > } > > } > > > > The issue is on scroll all of the check boxes are displayed/hidden > > incorrectly and the whole grid messes right up! > > > > Any ideas pls would be appreciated. > > > > Si > > > > > > > > > > > > > > > > > > > > > > > > >

