Results 1 to 2 of 2

Thread: View reference getter undefined

  1. #1
    Sencha User
    Join Date
    Feb 2012
    Vote Rating

    Default Unanswered: View reference getter undefined

    I'm pretty new to Sencha Touch 2 and trying to get used to it.

    I'm having a weird issue where I get the following error when I try to use getter for a ref that I defined.

    Ext.define('my.controller.Tests', {
        extend: '',
        views: [
        config: {
            'refs': {
                selectList: '#selectList',  // I tried selectList (xtype)
                createForm: '#createForm',
            'control': {
                '.user': {
                    focus: 'showOverlay'
        showOverlay: function() {
            var a = this.getCreateForm();
            a.setCentered(true); // this works.
            overlay = this.getSelectList();
            overlay.setCentered(true); // this doesn't work. overlay is undefined.
    createForm is a formpanel in a panel and selectList is a custom class extending Ext.List.
    The only difference I see is that getCreateForm() refers to non-top-level view and getSelectList() refers to a top-level view.

    Ext.define('my.view.test.SelectList', {
        extend: 'Ext.Panel',
        alias: 'widget.selectList',
        id: 'selectList',
    Ext.define('my.view.test.Create', {
        extend: 'Ext.Panel',
        alias: 'widget.whatever',
        config: {
            items: [
                    title: 'Create User',
                    xtype: 'formpanel',
                    id: 'createForm',
    I'm really frustrated.
    Please let me know what I'm doing wrong.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Gainesville, FL
    Vote Rating


    I would do it but the id in the SelectList class needs to be in the config object. I personally would stay away from setting an id especially in Ext.define.
    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

    Think my support is good? Get more personalized support via a support subscription.

    Need more help with your app? Hire Sencha Services

    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.

Posting Permissions

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