Perfect.

Thanks!

-Mark

On Jan 17, 2008, at 4:50 PM, Alex Harui wrote:


There is no public API for that. You can get to it from subclasses, but how depends on which version of Flex. Another way would be to use a custom ClassFactory.



2.x it is listItems[0][i]

3.0 it is header.headerItems[i]



From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mark Bradley
Sent: Thursday, January 17, 2008 11:52 AM
To: [email protected]
Subject: Re: [flexcoders] Re: DataGridColumn headerRenderer instance



That is a great idea I can use for the height and width.



However, I still need the x and y. I can probably infer the y from the datagrid y, but then I need a replacement to get the x. I am currently doing this:



                        var xOffset:int = 0;

var horizScroll:int = grid.horizontalScrollPosition;



for each ( var col:Dat! aGridColumn in grid.columns ) {

                                    if ( horizScroll == 0 ) break;

                                    xOffset += col.width;

                                    horizScroll--;

                        }



                        var xPos:int = headerRenderer.x - xOffset;



As you see, I am using the headerRenderer instance (which I only have when I have a mouse event to get it out of) to determine the x position.



I've got three of the four I need! Any ideas on a different way to get x?



Thanks!



-Mark



On Jan 17, 2008, at 1:41 PM, ben.clinkinbeard wrote:




Can you get dimensions via dgColumn.width and dg.headerHieght?

--- In [email protected], Mark Bradley <[EMAIL PROTECTED]> wrote:
>
> Thanks for the reply, but no.
>
> headerRenderer on DataGridColumn is a class factory object, and in
> cases where I am not specifically setting it, it is null (but actually
> rendered using the default DataGridItemRenderer).
>
> I actually need the instance so I can get it's dimensions.
>
> Thanks,
>
> -Mark
>
> On Jan 17, 2008,! at 1:06 PM, Sherif Abdou wrote:
>
> >
> > can;t u just do col.headerRenderer
> > ----- Original Message ----
> > From: Mark Bradley <[EMAIL PROTECTED]>
> > To: [email protected]
> > Sent: Thursday, January 17, 2008 1:01:41 PM
> > Subject: [flexcoders] DataGridColumn headerRenderer instance
> >
> > Greetings all,
> >
> > Can anyone tell me how to access the visible headerRenderer instance
> > given a DataGridColumn instance?
> >
> > public function getVisibleHeaderRen derer( col:DataGridColumn ):
> > Object {
> > var grid:DataGrid = this;
> >
> > // somehow get the header renderer (if it is visible)
> > r! eturn ??
> > }
> >
> > I'm really stuck here, but I know there has got to be a way! I can do > > it if I have a MouseEvent on the column header itself, but how can I
> > get it without an event?
> >
> > I've also tried DataGrid.getMeasuri ngRenderer, passing in the
> > DataGridColumn instance (and true) and I do not get back the correct
> > renderer (I actually get back the last header renderer).
> >
> > Any help?
> >
> > Thanks!
> >
> > -Mark
> >
> >
> >
> >
> > Looking for last minute shopping deals? Find them fast with Yahoo!
> > Search.
> >
> >
>







Reply via email to