PDA

View Full Version : Old card not disappearing when switching to a new Panel with a bound Dataview



jwall
25 Oct 2010, 7:39 PM
I have a setup where I have a main panel that holds many "cards". These cards are Ext.Panel objects set to fullscreen: true, and centered: true with a vbox Layout. I had created about 3 cards already, and was able to switch between them just fine. For some reason the next card I created wouldn't work. What I mean by that is that when I switched to it, the previous card wouldn't disappear, and instead the two would be rendered simultaneously on the screen. In both the new and the old card I had a DataView connected to a Store as the sole item in the Ext.Panel object that functioning as my card. After several hours of debugging (trial and error), I finally figured out what was causing this behavior... not having an itemSelector defined in my DataView on the new card. Hopefully this knowledge can save other people some problems.

evant
25 Oct 2010, 8:21 PM
The panels are contained in a card layout, which extends a fit layout. There's no need to make them fullscreen.

Mo-Sencha
26 Oct 2010, 5:18 AM
I am facing the exact same issue except I have the itemSelectors set and fullscreen is not set to true.

I call the doLayout function on the card after switching and it semi-fixes the problem..

Can someone provide guidance?

jwall
26 Oct 2010, 7:26 AM
I've noticed that the same thing happens if there is something wrong with the XTemplate too. It also happens if the itemSelector you have isn't properly formatted. Try removing the "store:" config property from the DataView and see if that fixes the problem. If it does then you know it has something to do with the DataView/Template. Even when my itemView and template were messed up, if I removed the "store:" property then the card would suddenly render properly (by that, I mean that the previous card would properly animate away, and the new card's Toolbar that I had bound would appear). This will at least help narrow down the problem for you.

Mo-Sencha
26 Oct 2010, 7:31 AM
Great guidance! I'll look into it further and provide an update once I've pinpointed the issue.

Thanks

Mo-Sencha
26 Oct 2010, 5:48 PM
Figured out the issue after a lot of debugging - hopefully this helps someone out there.

The new Panels that I was creating conflicted with Panels in another card in that they had the same ID. This made my application go completely wack and no errors were thrown - make sure you use different ID's for all your panels. Since I was automatically generating them I didn't notice they were the same.