解决方案 »

  1.   

    {
                    fieldLabel: '异议类型',
                    name: 'ObjectionType',
                    readOnly: true,
                    allowBlank: false,
    listeners:{keypress:function(o, e, eOpts){Ext.getCmp('txtMoney').setReadOnly(o.getValue()=='A')}}
                }, {
                    fieldLabel: '异议种类',
                    name: 'ObjectionMode',
                    readOnly: true,
                    allowBlank: false
                }, {
                    fieldLabel: '异议内容',
                    name: 'ObjectionContent',
                    readOnly: true,
                    allowBlank: false
                }, {
                    xtype: 'numberfield',
                    fieldLabel: '退还资金',
                    name: 'RefundMoney',
                    allowBlank: false,id:'txtMoney'
                }
      

  2.   


    谢谢版主回复 不过我改成下面的 还是没有效果,异议类型为A时,还是可以编辑
               fieldLabel: '异议类型',
                    name: 'ObjectionType',
                    readOnly: true,
                    allowBlank: false,
                    listeners: { keypress: function (o, e, eOpts) { Ext.getCmp('txtMoney').setReadOnly(o.getValue() == '买方违约') } }
                }, {
                    fieldLabel: '异议种类',
                    name: 'ObjectionMode',
                    readOnly: true,
                    allowBlank: false
                }, {
                    fieldLabel: '异议内容',
                    name: 'ObjectionContent',
                    readOnly: true,
                    allowBlank: false
                }, {
                    xtype: 'numberfield',
                    fieldLabel: '退还资金',
                    name: 'RefundMoney',
                    allowBlank: false, 
                    id: 'txtMoney'
                }]
      

  3.   

    为省事,A 就是上面代码中的 买方违约弱弱的问下版主, 为什么这里用的是 keypress? 
      

  4.   

    原本是想用blur事件的,但是blur事件需要ext4.1+版本,不知道你的ext版本多少的
      

  5.   

    如果是版本原因, 那 不用listeners, 还有能有其他适合的方法吗
      

  6.   

    2.0...api都不知道去哪找来看了。。自己看2.0的apisetReadOnly好像都要2.3+才支持这个方法
      

  7.   

     
    原来这样, 谢谢版主了。也算学习了setReadOnly