1. #1
    Sencha User
    Join Date
    Feb 2012
    Posts
    17
    Vote Rating
    0
    prudvi is on a distinguished road

      0  

    Default Unanswered: Idiomatic Layouts in Sencha Touch 2 MVC

    Unanswered: Idiomatic Layouts in Sencha Touch 2 MVC


    Hi,
    Any one has idea about idiomatic layouts in Sencha 2 with MVC. Please share sample idiomatic layout App in Sencha 2 using MVC if u have.
    I am trying to create a new App but i am getting lot problems.i have seen this link
    http://www.sencha.com/learn/idiomati...h-sencha-touch ,but it is not that much useful because it is not in MVC. Please help me...

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,647
    Vote Rating
    899
    Answers
    3575
    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


    That tutorial is for Sencha Touch 1, it could be modifiable to be used in MVC but there are things there that ST2 does not do like the profile changing.

    You can listen for the orientationchange event on Ext.Viewport (xtype viewport) to handle orientation change to update if something should be docked or floating by a button.

    The KitchenSink does exactly what you want also
    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 User
    Join Date
    Feb 2012
    Posts
    17
    Vote Rating
    0
    prudvi is on a distinguished road

      0  

    Default


    Hi,
    Thanks for ur reply....
    As per my observation in ST1 kitchen sink is using idiomatic layouts..where as in ST2 it is not....

    And when i am trying to implement idiomatic layouts using ST2 MVC, iam getting some problems.
    i have a header,panelone and paneltwo

    in portrait mode header and paneltwo should be displayed and in landscape mode all should be displayed.please refer to the below code..

    if(Ext.Viewport.getOrientation()=="portrait")
    {
    this.add([header1,panel2]);
    }
    else
    {
    this.add([header1,panel1,panel2]);
    }

    if i load the app on landscape mode everything is fine...but in portrait mode i am not getting panel1 on orintation change. please refer to the below code..


    changeLayout: function() {
    var MainView= this.getMain();
    var panelinstance= this.getPanel();
    if(Ext.Viewport.getOrientation()=="portrait")
    {
    console.log("portrait");
    MainView.remove(panelinstance, false);
    }
    else
    {
    MainView.add(panelinstance);
    console.log("Landscape");
    }
    },


    may be the problem is panel1 is not getting registered if load the app on portrait mode. Could you please help me to fix the issue?

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2011
    Location
    San Antonio, TX
    Posts
    93
    Vote Rating
    0
    Answers
    4
    jnotti is on a distinguished road

      0