Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sencha touch 调用无线电场检查上的事件_Sencha Touch_Extjs_Sencha Touch 2_Radio - Fatal编程技术网

Sencha touch 调用无线电场检查上的事件

Sencha touch 调用无线电场检查上的事件,sencha-touch,extjs,sencha-touch-2,radio,Sencha Touch,Extjs,Sencha Touch 2,Radio,我正在创建一个无线电场,我需要在检查无线电场时创建一个事件 我使用的代码是: items : [ { xtype : 'toolbar', docked : 'top', //id:'popupTitle', title : 'Send options', height : 30 }, { xtype : 'radiofield',

我正在创建一个无线电场,我需要在检查无线电场时创建一个事件

我使用的代码是:

items : [ {
            xtype : 'toolbar',
            docked : 'top',
            //id:'popupTitle',
            title : 'Send options',
            height : 30
        }, {
            xtype : 'radiofield',
            //  ui:'plain',
            id : 'r1',
            name : 'sendDoc',
            value : 'Default',
            label : 'Default',
            labelWidth : '50%',
            checked : true,
            //baseCls: 'x-plain',

            listeners : {
                check : function() {
                    var rad = Ext.getCmp('r1');
                    if (rad.isChecked()) {
                    }
                }

            }
        }, 
        {
            xtype : 'radiofield',
            name : 'sendDoc',
            id : 'r2',
            value : 'Source Workstep',
            label : 'Source Workstep',
            labelWidth : '50%',
            listeners : {
                check : function() {
                    var rad2 = Ext.getCmp('r2');
                    if (rad2.isChecked())   {
                        //alert("hi");
                        if (!this.workstepOverlay) {
                        this.workstepOverlay = Ext.Viewport.add({
                            xtype : 'workstepOverlay'
                        });
                        this.workstepOverlay.show();
                    }

                    }

                }

            }
        } ]
但这似乎不起作用

我得到一个错误,上面写着“请求的值的键不是对象”


我做错了什么?

如果事件被触发,请尝试这样访问您的无线电场:

check( radiofield, event, opts ){
    if(radiofield.isChecked()){

    }
}

希望这有帮助

如果事件被触发,请尝试这样访问您的无线电场:

check( radiofield, event, opts ){
    if(radiofield.isChecked()){

    }
}
希望这有助于收听活动

选中复选框时激发

倾听事件

选中复选框时激发


您能否告诉我们是否触发了事件(请尝试侦听器中的console.log(“foo”))是..触发了事件。当我被放置在侦听器中时,我确实收到了一个警报。您能告诉我们事件是否被触发(请在侦听器中尝试一个console.log(“foo”))是..事件被触发。当我被放置在监听器中时,我确实收到了一个警报。