PDA

View Full Version : Open link in same panel



Appaddict
5 Jul 2011, 1:21 AM
Hi guys,

I want to open an image in a panel.

I've send you the code by DM

Hanni Sullivan
5 Jul 2011, 1:25 AM
What do you mean by "open". You are currently displaying a thumbnail of your image and if the user clicks on it, you want to display it in full size?

Appaddict
5 Jul 2011, 1:30 AM
Hi Hanni,

yes thats what I mean, maybe in a pop or in the same panel.

Hanni Sullivan
5 Jul 2011, 1:54 AM
I would use a CardLayout (see Sencha Touch API (http://dev.sencha.com/deploy/touch/docs/?class=Ext.layout.CardLayout)) and if the user clicks on the thumbnail (displayed on the first card), I would show the full sized image on a second card by setting it as the active item.

Hanni Sullivan
5 Jul 2011, 2:17 AM
Could you post your whole "MorePanel" class?

Appaddict
5 Jul 2011, 2:18 AM
send by private mail

Hanni Sullivan
5 Jul 2011, 3:25 AM
Thank you. This makes it a lot clearer. To me it seems that your on the right track.

I would add a third item, say an Ext.Panel, in which the full size image can be displayed to the items of your MorePanel. In the afterRender method where you already listen to the itemtap event of your pageList, I would additionally listen to the itemtap event of your pageDetail and if somebody taps one your images, I would switch to the Panel which displays the image and show a back button, so that the user is able to get back to your pageDetail list.

So the flow would be:

Card 1 (list of item titles) -> tap -> Card 2 (list of photos) -> tap -> Card 3 (full size image).
Card 3 -> back button -> Card 2 -> back button -> Card 1

Instead of having 2 cards you would simply have 3. I hope I was clear enough.