View Full Version : [Solved] Puzzling problem with card layout

4 Nov 2009, 4:34 PM
I am using a PHP script to dynamically generate a new Ext.Panel using the 'card' layout to display the results of a database query as one tab in a TabPanel. There is a toolbar at the top of the card panel with buttons to navigate forward and backward through the cards. All of this works fine when I first load the application in the browser. However, when I use a link in my user interface to run the query again and reload the tab, only the first card is displayed at first. The forward navigation button takes me to a blank card. If I back up and go forward again, the previously visited card finally displays properly. Each card needs to be visited and displayed as blank before it before it is finally displayed properly upon being revisited.
What do I need to do to eliminate this annoyance for my users? I have tried calling doLayout() on the proper containers at various places in the code, but nothing has worked. Any ideas or solutions would be greatly appreciated.

6 Nov 2009, 10:20 AM
I thought I'd post the solution to my problem, just in case it is useful to others. After more searching of this forum, I found a post by someone with a somewhat similar problem who had solved it by adding these config items to the definition of the Ext.Panel using a 'card' layout:

layoutConfig: {layoutOnCardChange:true},
defaults: {hideMode:'offsets'}

While l had already added the layoutOnCardChange line, that was not sufficient. I needed to change the hideMode default value to 'offsets', which resulted in all of my cards being visible when each was made the active item immediately after the interface was displayed.