PDA

View Full Version : list of listeners? I want to trigger after orientation change has fully finished



senchito
25 Aug 2011, 2:27 PM
Hi all.

I am having the hardest time figuring out which listener to use so that it triggers after the layout has fully finished re-orienting following an orientation change.

I have tried using setProfile and adding a listener to afterRender and combinations of the two and these events always fire before the various panels have finished being laid out.

My panels do all get laid out properly despite my application being very complex with many nested panels and containers. But if I throw javascript alerts inside the above triggers I can clearly see that at the time the alert is thrown the screen has not yet reached its "final" layout.

The reason this is messing me up us because what I want to do is calculate the height and width of a container once the orientation change has finished and apply new styles/dimensions to html elements within based on the container's dimensions. This is working perfectly for me when I first load in portrait or landscape. But then when I switch orientations because the trigger fires too early it doesn't fetch me the dimensions of re-oriented container, instead it uses the width of the OLD orientation.

I'm sorry but I cannot post the code, first of all it's way too complex with over a thousand line already written and secondly my employer doesn't want me to.

Bottom line is.. how can I listen to when the screen has completely finished relaying itself out following an orientaiton change?

Something similar to body.onload.

Also... if someone could provide me with a full list of available events that I can listen to that would be so helpful I'm sure I've looked everywhere for it and can't find much information about this.

Thank you