Controller for Buttons Sencha Touch 2

*爱你&永不变心* 提交于 2019-12-11 08:46:48

问题


I have this problem that I can ref a button for control it. I don't understand the logic of Controllers, see my example code:

Ext.define('myMoney.controller.Inicio', {
    extend: 'Ext.app.Controller',

    config: {
        refs: {
            loginForm: '#loginForm',
            logButton: '#logButton',
        },
        control: {
            logButton: {
                tab: "autenthic"
            }
        }
    },

    autenthic: function(){
        console.log("Wazzup!?");
    }
});

I have my view:

Ext.define('myMoney.view.Inicio', {
    extend: 'Ext.form.Panel',
    xtype: 'inicio',

    requires: [
    'Ext.form.FieldSet',
    'Ext.field.Password'
    ],

    config: {
        title: 'Inicio',
        iconCls: 'home',
        styleHtmlContent: true,
        scrollable: true,

        items: [
            {
                xtype: 'toolbar',
                title: 'Money Tracker',
                docked: 'top'
            },
            {
                xtype: 'fieldset',
                title: 'Inicio de Sesion',
                id: 'loginForm',
                instructions: '(Por favor coloca tu usuario y clave)',

                items: [
                    {
                        xtype: 'textfield',
                        name: 'us',
                        label: 'Usuario'
                    },
                    {
                        xtype: 'passwordfield',
                        name: 'pw',
                        label: 'Clave'
                    }
                ]
            },
            {
                xtype: 'button',
                width: '50%',
                centered: true,
                text: 'Aceptar',
                ui: 'confirm',
                id: 'logButton'

            }
        ]

    }

});

What is wrong?


回答1:


Instead of

tab: "autenthic"

write

tap: "autenthic"


来源:https://stackoverflow.com/questions/11131813/controller-for-buttons-sencha-touch-2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!