1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
    andygrant is on a distinguished road

      0  

    Default Setting Title when using ref

    Setting Title when using ref


    I have a navigation view, in which go a search, search summary and detail panels/cards.

    I find I can use the 'ref' feature in Architect to set up references to containers which I later 'push()' into this app. But I find if I use 'ref' ( auto-create) I cannot find a way to set the title. The only way I seem able to set the title is not to use 'ref' and instead code it as per the below:

    var results = Ext.create('LyricsTo.view.SearchResults', {
    title: 'Search Results'
    });

    Am I missing something here, or is this ok? Just want to be sure I'm grasping the right way to do MVC in Sencha Touch 2.

    Cheers,
    Andy

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


    refs aren't an Architect feature, it's a feature of Sencha Touch 2 (and Ext JS 4) MVC. All it is a way to hold a reference to a component. So if you set it to a string it will attempt to look it up using ComponentQuery. Set it to an object it will try to resolve it based on the selector config and if it doesn't find a reference and autoCreate is set to true, it will attempt to create it using the xtype config.
    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