我正在创建一个无线电场,我需要在检查无线电场时创建一个事件。
正在使用的代码是:
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();
                    }
                    }
                }
            }
        } ]
但这似乎不起作用。
我收到一条错误消息,提示“请求的键值不是对象”
我究竟做错了什么?