View Full Version : What am I doing wrong with doComponentLayout?

16 Aug 2011, 7:43 PM
I am having a lot of issues with my app and it all seems to revolve around doComponentLayout not behaving how I expect it to. I wanted to list out the issues I am having so that hopefully people can direct me to work arounds or tell me what I am doing wrong.

mapButtonContainer.show({type: 'slide', direction: 'up'});

In this example I am updating the XTemplate I am using to populate the button content. I show the button container which means that I call a doComponentLayout because I believe it requires a recalculate. I am calling the update for the XTemplate again because I depend on the data member of the button and after doComponentLayout is called the data member is gone for some inexplicable reason.


In this example I am hiding the mapButtonContainer and then calling doComponentLayout on its parent panel. The button and container no longer render but the space they occupied are still empty instead of being filled by the rest of the container contents.

I am also having a lot of issues with doComponentLayout causing my map to disappear altogether.

I have noticed that manually resizing my browser (when I am viewing my app in a browser) will often get the issues to correct themselves. Is there a call in Sencha Touch that I can use to force a redraw of the screen or barring that is there a way that I can trick the app to believe it is getting resized so that it will in turn force a redraw? This obviously would not fix my button's data object issue. I am not sure it is a valid Sencha Touch bug because I have not been able to produce a reliable small reproducible.

16 Aug 2011, 8:02 PM
I just found a thread that suggested maybe using Ext.repaint(). I just tried that with no success.

26 Sep 2011, 7:21 AM
I am having similar issues with refreshing a component. Have tried doComponentLayout and the Ext.repaint with no success. Did you ever get past this issue?

24 Jan 2012, 10:25 AM
wow, i'm not alone fighting this issue.. i have no idea how to solve the problem..
i'm trying to hide tabbar placed as a docked item to a panel..

29 Feb 2012, 11:32 AM
Same here, can't hide a docked toolbar properly

29 Feb 2012, 11:38 AM
I followed this post (http://www.sencha.com/forum/showthread.php?125339-Trouble-refreshing-TabPanel-with-doComponentLayout&p=575917&viewfull=1#post575917) and placed the doComponenetLayout() in the 'show' listener and it worked.