Results 1 to 2 of 2

Thread: Setting Title when using ref

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    11
    Vote Rating
    0
      0  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Vote Rating
    1272
      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 @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

Posting Permissions

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