View Full Version : Feeling lost!

31 Jan 2012, 11:54 AM
I have read and practice everything in the Sencha touch training areas I could find. I feel stupid and lost still. I just need some pointers on how to combine the tasks I want to do. It will not be able to dynamically load from php or json it has to hold all my data and images in it because most areas do not have phone access or wifi.

First create a main panel which holds long buttons on it to go to new cards or panels (I think that is the word to use).

Second the new cards or panels will have to do various things. One I need to list items sorted alphabetically that when touched load a card or panel for that item then the top docked bar should show a back button and so on.

Third need to go to a new card that has choices of images or information. The images need to be scrollable with possible captions as well.

I know this is a lot to ask for but just small snippets and help I am sure I can do it.

31 Jan 2012, 12:25 PM
So what you need is a Container using card layout (let's call it the main container). This main container will have a top docked toolbar with a hidden back button. You will then only have a single container under it that has your "long" buttons to go to the list. The reason you don't have the list as an item at this point is to keep the DOM lightweight, only have what is visual rendered at any one time.

On tap of a button that will forward you to the list, you can use setActiveItem on the main container passing in a config object for the list.

When you tap on a list item, you then use setActiveItem on the main container once again to show information on that record.

So to traverse forward and back in the main container, you use setActiveItem. setActiveItem can accept a couple different parameters... you can pass an index (which will get the component instance at that index), a component instance, or a config object (which will create that item, add it to the end of the item list) and switch to that instance.

Now when something is animated off the screen, you can destroy it to keep everything lightweight. Using the activeitemchange event on the main container, you then can hide/show the button based on what item that was changed too.

7 Feb 2012, 1:01 PM
I started something i hope is what you meant. I got to the menu list and sorta froze again. May i ask if you would not mind looking at what i have so far and let me know if I am on the right path?


thank you,