1. #1
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
    UbuntuPenguin is on a distinguished road

      0  

    Default Unanswered: PR4 Still looking for Viewport.js ?

    Unanswered: PR4 Still looking for Viewport.js ?


    Hello,
    Does PR4 still need a Viewport.js and have autoCreate=true class ? In my code I have

    Code:
        launch:function(){Ext.create('MyApp.view.Main'); 
    So is it wrong to assume that the MyApp.view.Main is considered the top-level view class ?

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,004
    Answers
    3489
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    There is no autoCreateViewport config anymore. If you are using profiles then is it preferred to create your main view in the launch method of the profile. If not then you can do it in a controller
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2011
    Posts
    162
    Answers
    7
    Vote Rating
    2
    UbuntuPenguin is on a distinguished road

      0  

    Default


    Nevermind, I think the master-container would be the Main.js file found in the profiles folder. Oops....

    Okay, so I have investigated the Profiles addition to the PR4 release. When I declare a profile, I can declare a number of views. Which one will the system see as the "main" view, similar to the old viewport.js. Will it be the one named Main.js or the first one listed in the array ( [Biscuits,Main,Molasses] where Biscuits is the main view).

    I guess my real question is that in PR3 we had Viewport.js which was the master container and entry point for the rest of our app. PR3 knew to look for it unless told otherwise. In PR4 I am not aware of any implicit default master containers.

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,004
    Answers
    3489
    Vote Rating
    847
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by UbuntuPenguin View Post
    Nevermind, I think the master-container would be the Main.js file found in the profiles folder. Oops....

    Okay, so I have investigated the Profiles addition to the PR4 release. When I declare a profile, I can declare a number of views. Which one will the system see as the "main" view, similar to the old viewport.js. Will it be the one named Main.js or the first one listed in the array ( [Biscuits,Main,Molasses] where Biscuits is the main view).

    I guess my real question is that in PR3 we had Viewport.js which was the master container and entry point for the rest of our app. PR3 knew to look for it unless told otherwise. In PR4 I am not aware of any implicit default master containers.
    You can name your "main" or "viewport" class whatever you want, PR4 and newer there are no constraints like there was in PR3 and older.

    If you are using a profile, you should create the view either with Ext.create or the new keyword. For example, here is a working profile I am using:

    Code:
    Ext.define('TF.profile.Tablet', {
        extend : 'Ext.app.Profile',
    
        config : {
            name      : 'tablet',
            namespace : 'tablet',
            views     : [ 'Viewport' ]
        },
    
        isActive : function() {
            return Ext.os.is.Tablet || Ext.os.is.Desktop;
        },
    
        launch : function() {
            new TF.view.tablet.Viewport();  //could be Ext.create('TF.view.tablet.Viewport');
        }
    });
    In TF.view.tablet.Viewport's config object, I have fullscreen : true so it will be added to the global Ext.Viewport (which is a container using card layout).

    If you are going to not use Profile, then you can create your view in the launch or init method of the controller like I did in the launch method of the profile above.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1