Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    13
    Vote Rating
    0
    neobach is on a distinguished road

      0  

    Default The getter of Controller is fail!

    The getter of Controller is fail!


    Hi guys,
    I have some troubles with the getter when I configured the refs for Controller. The getter only available with only one member in refs, the others was fail.
    I have two views:
    Code:
    Ext.define('Test.view.panelEdit', {
        extend: 'Ext.Panel',
        config: 
        {
            id: 'panelEdit',
            layout: 
            {
                type: 'fit'
            },
            items:
            {
                xtype:'button',
                id: 'buttonNew',
                text: 'New'
            }
        }
    
    
    });
    Code:
    Ext.define('Test.view.panelList', {
        extend: 'Ext.Panel',
        
    
    
        config: 
        {
            id: 'panelList',
            layout: 
            {
                type: 'fit'
            }
        }
    
    
    });
    and one controller:
    Code:
    Ext.define('Test.controller.controllerMain', {    extend: 'Ext.app.Controller',
        config: 
        {
            views: ['panelEdit', 'panelList'],
            refs: 
            {
                panelEdit: '#panelEdit',
                panelList: '#panelList'
            },
            control: 
            {
                "#buttonNew": 
                {
                    tap: 'onButtonNewTap'
                }
            }
        },
    
    
        onButtonNewTap: function(button, e, options) {
            var edit = this.getPanelEdit();
            var list = this.getPanelList();
            console.log(edit.getId());
            console.log(list.getId());
        }
    
    
    });
    Error: getterBug.jpg

    But when I call the getter in the controller, it's not operate?
    What should I do?

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


    Your code is working for me in 2.0.1.1, tapped the button 3 times and it worked all 3 times.

    Screen Shot 2012-06-21 at 8.02.47 AM.png
    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
    May 2012
    Posts
    13
    Vote Rating
    0
    neobach is on a distinguished road

      0  

    Default still not work!

    still not work!


    Hi mitchellsimoens,
    I have tested again on the Safari and Chrome, but it still not work. I don't know why.
    I'm using sencha-touch 2.0.1.1 and sdk tool 2.0.0 beta 3 on Window 7 OS.
    Do you have any suggestion for my trouble?
    Thanks!

  4. #4
    Sencha User
    Join Date
    May 2012
    Posts
    13
    Vote Rating
    0
    neobach is on a distinguished road

      0  

    Default fixed

    fixed


    Hi,
    I have found the reason . Because I only add one panel to the viewport, but we must add both of them to viewport if you want the getter'll work.
    Thanks all.

Thread Participants: 1

Tags for this Thread