extJs单选框(radio)如何设置为不可编辑

2024-11-05 10:19:21
推荐回答(3个)
回答(1):

readOnly : true 可以的亲自试过,下面是我测试的代码。


Ext.onReady(function() {
var FieldContainer = Ext.create('Ext.form.FieldContainer', {
 乱哗   items : [{
        xtype : 'fieldcontainer',
        layout : 'hbox',
        fieldLabel : 'Size',
        defaults : {
            flex : 1
        },
        defaultType : 'radiofield',
        items : [{
            boxLabel : 'M',
            name : 'size',
            inputValue : 'm',
            readOnly : true,
            id : 'radio1'
        }, {
            boxLabel : 'L',
            name : 'size',
            inputValue : 'l',
     哗者行       readOnly : true,
            id : 'radio2'
        }, {
            boxLabel : 'XL',
            name : 'size',
            inputValue : 'xl',
            readOnly : true,
            id : 'radio3'
        }]
    }]
});
Ext.create('Ext.container.Viewport', {
    layout : 'vbox',
        items : [FieldContainer]
    });
});


如果你的 readOnly 没起作用,就说明写错地方了。要不发一嫌毁下你的代码。

回答(2):

{     
xtype:'radio',
fieldLabel  : "www",
disabled :true

}

 

radio设置不基高可编辑只能用disabled:true,它的效果就是变灰,不可选中

如果你不非得不想变灰团森,那么请重写塌锋亩ext-all.css或者自己加个弄个新的样式

回答(3):

editabled:false 试试这个看 不敢肯定