Results 1 to 6 of 6

Thread: New PR4 refs documentation missing something?

  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    212
    Vote Rating
    3
      0  

    Default New PR4 refs documentation missing something?

    I'm trying to get the new ref structure working and I'm running into some problems. The getRefname structure used to work and now it doesn't even though I'm using the refs as documented in PR4. Am I missing something?

    BTW: The new refs structure is much better than the old way.

    Code:
    refs: {
        mainTitleBar: 'mainview titlebar',
    },
    Code:
    Ext.define('MyApp.view.Main', {
        extend: 'Ext.Container',
        
        config: {
            
            layout: 'card',
            items: [
                {
                    xtype: 'titlebar',
                    docked: 'top',
                    items: [
                        {
                            xtype: 'button',
                            itemId: 'homeButton',
                            iconCls: 'home',
                            iconMask: true,
                            ui: 'plain',
                            align: 'left'
                        },
    
    ...
    Code:
    this.getMainTitleBar().setTitle(this.appTitle);
    
    TypeError: 'undefined' is not an object (evaluating 'this.getMainTitleBar().setTitle')

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      0  

    Default

    It looks like your MyApp.view.Main class doesn't have an xtype assigned to it.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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
    Apr 2011
    Posts
    212
    Vote Rating
    3
      0  

    Default

    The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

    Thanks!

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      0  

    Default

    Quote Originally Posted by bweiler View Post
    The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

    Thanks!
    You should always define your own xtype.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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.

  5. #5
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,159
    Vote Rating
    7
      0  

    Default

    Quote Originally Posted by bweiler View Post
    The xtypes used to be created automatically in previous PR versions. I'm not sure why this would change, but I do like the new ref structure.

    Thanks!
    Yup, this happened in the old MVC - but we don't think it makes sense and that it is too much magic. You'll need to define your types manually as Mitchell said.
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

  6. #6
    Sencha User edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    11
      0  

    Default

    Yea this was overlooked in the migration guide, I'll update it
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

Posting Permissions

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