Results 1 to 2 of 2

Thread: Alternating between login and content

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    156
    Vote Rating
    2
      0  

    Default Alternating between login and content

    Hello friends,

    Maybe the answer to my question is very easy, but I can't found a solution after a long time today.
    I'm using Sencha Architect 3.
    I have two views, a login form and a main view (for showing after logged)
    Everything works fine... the user submit the form and after successfully validation I try to show the main view... but the new view are "appended" to login instead clean first the view.

    In the app.js I have the following:
    Code:
    // @require @packageOverrides
    Ext.Loader.setConfig({
    
    
    });
    
    
    Ext.application({
        views: [
            'MainView',
            'LoginForm'
        ],
        controllers: [
            'LoginController'
        ],
        name: 'SF1Admin',
    
    
        launch: function() {
            // if logged == true, user logged successfully
            if (logged) {
                Ext.create('SF1Admin.view.MainView', {renderTo: Ext.getBody()});
            } else {
                Ext.create('SF1Admin.view.LoginForm', {renderTo: Ext.getBody()});
            }
        }
    
    
    });
    What is wrong?
    Best regards and have a nice day!!!

  2. #2
    Sencha User
    Join Date
    Dec 2008
    Location
    France
    Posts
    319
    Answers
    5
    Vote Rating
    2
      0  

    Default

    Maybe something like Loginform.destroy() or LoginForm.close() after loading the MainView.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •