2013-04-30 29 views
2

如何通過mvc將特殊鍵事件添加到數字字段。 任何人都可以幫助我。 下面extjs4.1如何通過mvc將特殊鍵事件添加到字段

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

我from.panel文本框我這個它會幫助你

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

感謝@omar其工作 – Umar 2013-04-30 07:26:32

相關問題