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

      0  

    Default Using Buttons to change Views.

    Using Buttons to change Views.


    I can not find a good example of a button, outside of a tab or navigation bar, that will change views. How is this done?

    I want the buttons to "link" to a specific view (based on which button tapped) contained within a tabPanel. Basically two ways to get to that view. One from the home/splash view and once you tap on a button it would go the tabPanel view from there on out.

    Any help understanding this would be appreciated!

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


    You have to use setActiveItem on the component you want to change an active item.
    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
    Jan 2012
    Posts
    1
    Vote Rating
    0
    jrahl is on a distinguished road

      0  

    Default


    Hi, Sorry, I'm struggling with this, too. Currently I have


    Ext.Viewport.setActiveItem({
    xtype: 'addtostory'
    });

    where addtostory is the useralias of a view I have (this was following along in a webinar). I'm very confused! Are there any instructions around for setting a button to change to a different view?
    I'm new to sencha and using Architect 2, and not much of a programmer.
    I like how the tab navigation works, but have specific cases where that isn't desired and would just like a good old fashion button!

    Big learning curve, but getting there! <3 Sencha so far.
    Regards,
    Jaimee