Solved

How can you get the x,y coordinates of a datagrid headerRenderer in Flex?

Posted on 2008-10-08
3
1,012 Views
Last Modified: 2008-12-02
I am creating a headerRenderer for a datagrid, and the code works as expected, however I need to find the x,y coordinates of the content in the renderer.

I have tried tips/hints online, but nothing works -- it always gives back 0,0 as the coordinates, even when using the function to convert local to global.

Is there some trick to getting the actual x,y coordinates from inside a datagrid header component?  I believe the same problem exists for cells in itemrenderers.



var pt:Point = new Point(this.x,this.y); 
pt = localToGlobal(pt); 
 
pt.x SHOULD be the global X position, but is ALWAYS zero.
pt.y SHOULD be the global Y position, but is ALWAYS zero.

Open in new window

0
Comment
Question by:andrewschwabe
  • 2
3 Comments
 
LVL 4

Expert Comment

by:ngiamouris
ID: 22676789
Are you calling the localToGlobal function of the datagrid object itself?
eg myGrid.localToGlobal(myPoint)
0
 

Author Comment

by:andrewschwabe
ID: 22712659
I wasn't and tried that just now, and no that doesn't work either -- it still returns 0,0 no matter what.  I think this must be a bug...
0
 
LVL 4

Accepted Solution

by:
ngiamouris earned 500 total points
ID: 22712708
Maybe you're trying to determine the coordinates before the actual component has been laid out. Try hooking on the updateComplete event and see if the coordinates still remain 0,0.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

First things first - Preparation We need all the part for this install and it's much nicer to have them all on hand when you need them so here's what's required. Download Eclipse 3.5 32 bit (I like the Classic flavour) from here. (http://www.e…
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question