1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    69
    Vote Rating
    0
    jonhobbs is on a distinguished road

      0  

    Default Switching views using a button

    Switching views using a button


    Hi Guys,

    This should be a simple one hopefully....

    I've created two views in Sencha designer, a splash screen and a registration form. The splash screen has a "register" button on it and when it's tapped I'd like to switch from the splash screen to the registration view.

    I'm not using a navigation view because I don't want a title bar on the splash screen. I'm also not using a card layout or anything like that, just two distinct views.

    So, do I use the 'tap' action on the button and put the code in there or should I put the logic in a controller?

    Also, should I Hide/Show the views or should I create/destroy them?

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,188
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    Sounds like you should be using a container with a card layout.

    On tap you will just want to invoke setActiveItem for the next card.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Sencha User
    Join Date
    Apr 2008
    Posts
    69
    Vote Rating
    0
    jonhobbs is on a distinguished road

      0  

    Default


    Thanks Aaron,

    I think in this instance the card layout will work, but once the user has registered or logged in I'd like to take them to a completely fresh view as they won't be going back to the splash screen again. Is tere a way to do what I'm trying to do or should I just keep nesting card layouts and not worry about keeping lots of views in memory?

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,188
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    remove and destroy the register page once its been used
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Sencha User
    Join Date
    Apr 2008
    Posts
    69
    Vote Rating
    0
    jonhobbs is on a distinguished road

      0  

    Default


    Sorry, I'm a complete beginner and I was asking how to do this. Where does the logic go, in the button tap event or in some kind of controller?

  6. #6
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,188
    Vote Rating
    119
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    It can go in either place. You'll want to set the activeItem to the other page, remove the old item and destroy it.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  7. #7
    Sencha User
    Join Date
    Apr 2008
    Posts
    69
    Vote Rating
    0
    jonhobbs is on a distinguished road

      0  

    Default


    OK, thanks Aaron, I'll give it a go.

Thread Participants: 1

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi