PDA

View Full Version : Noobie trying to select views



darkorigins
28 Jan 2013, 5:40 AM
Hi All,

Firstly, if this is a stupid question please forgive me, I'm only on day 2 of learning Ext JS & Architect :-)

The desktop application I'm trying to create is a fairly standard one where a user is presented with a login screen, then proceeds on to a main application.

I have a number of views created;
- Login screen (initial)
- Main application (Header / footer / tree menu to left / one of the following panels in centre)
- Edit users Panel
- Reporting
- Something else panel 3
- etc

What I cannot find is a way to say 'Swap to a different view'. So when a user logs in successfully the Login view is hidden and the main application view is shown.

Then when one of the menu options on the main view's menu is selected I need to swap the centre panel of the main view to the correct panel/view for that option.

Essentially swapping panels in the same way that the 'tab panel' does.


Can anyone help ;-?

Thanks

Mark

Farish
28 Jan 2013, 6:47 AM
I think what you are looking for is the card layout. Here is the documentation link:

http://docs.sencha.com/ext-js/4-0/#!/api/Ext.layout.container.Card

You should assign card layout to the container in which you wish to place your different panels. Using the setActiveItem() method, you can change the child panel which you want to display.

darkorigins
28 Jan 2013, 6:51 AM
Hi Farish

Thanks for your swift response!

I'll have a look at the card layout now. I'd assumed card layout was simply a forward / back sequential container for creating wizards or alike.

Farish
28 Jan 2013, 6:59 AM
no its not sequential; you can set any child item as the active item using setActiveItem().