Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2008-10-08
3
Medium Priority
?
1,025 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

610 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