View Full Version : Best approach to structuring an Ext.Panel

23 Nov 2011, 4:48 AM
Hi Guys,

I would just like to hear your views about the best approach to 'design' or 'structure' Ext.Panels.

Basically what I have is a js file containing various new Ext.Panels and an Ext.List.

To get the List and the first panel to render together I added them as items to the Panels items array. However, the examples I see on the internet for the 'onItemDisclosure' of the list and its back button ... they are just using 'card' layout, which means my approach will not work as I have multiple objects/items contained in the one Panel.

So, my question is this:

Should I have just one 'card' layout and design the layout of the content via HTML? Or Is there another approach to navigating back via the back button?

I can provide code samples if necessary


23 Nov 2011, 8:01 AM
Think about it... you tap on something and it goes forward in your app... you hit the back button and it goes back... what do you envision. I envision something like using card layout.

Not knowing what version of Sencha Touch you are referring to, I will just assume you mean ST1...

new Ext.Panel({
fullscreen : true,
layout : 'card',
cardSwitchAnimation : 'slide',
items : [
xtype : 'panel',
html : 'First Card
xtype : 'panel',
html : 'Second Card

Now you will only see one panel at a time within the panel that has layout: 'card'

24 Nov 2011, 1:49 AM

thanks for the reply but I don't think you understood what I meant.

See I had an Ext.Panel with a title and count total and an Ext.List obviously for a list of objects ... and wanted the two rendered together ...

but the card layout can only render one object/item at a time.

It's grand now though as I have found an example that uses the viewport with a card layout, which then allows you to add a Panel and a List

thanks for the reply though