2 Replies Latest reply on May 12, 2008 10:12 AM by JKohn99

    Determining component size

    neeraj08
      We have app where component may be resized at runtime.

      I kind of understand how components and containers are resized using height, widht, percentHeight and percentWidth settings and have gone through some of the articles on it on internet. My question is there a property which gives size of a component in pixels at runtime. It seems height and width properties only contains the initial setting and is not updated at runtime.

      I know we can try to calculate component size using setttings, parent settings and settings of parents parent etc. Apart from being very trick, it will anyway not give the size if component is resized at runtime.
        • 1. Re: Determining component size
          neeraj08 Level 1
          I found the problem. height property does get updated with the actual size at run time. However, I was looking at it in the override function createChildren(). It is not available in that function, so I guess it is initially updated later in the component cycle. Now I capture the CREATION_COMPLETE event and can read the height property there.
          • 2. Re: Determining component size
            JKohn99 Level 1
            You can also override the measure() function and get the current
            width and height after calling super.measure().

            You can always force a measure() by calling
            this.invalidateSize();