extjs4.1如何通过mvc向字段添加特殊键事件

时间:2013-04-30 07:11:36

标签: extjs4.1

如何通过mvc将特殊键事件添加到数字字段。 有谁能够帮我。 我的from.panel文本域下面

extend              : 'Ext.form.Panel',
    alias               : 'widget.sv01i00900104',
    id                  : 'sv01i00900104',


{
            xtype             : 'numberfield',
            name              : 'rebatePercent',
            fieldLabel        : 'Percent:',
            flex              :  1,
            minValue          :  0,
            maxValue          :  100,
            mouseWheelEnabled :  false,
            hideTrigger       :  true,
            decimalPrecision  :  0,
            keyNavEnabled     :  false                                        
        }

1 个答案:

答案 0 :(得分:1)

我这会帮助你

'sv01i00900104 numberfield[name = rebatePercent]' :{     
           specialkey: function (field, el) {
                if (el.getKey() == Ext.EventObject.ENTER){
                  console.log('hello world');
                }
              }
        }