`

ExtJs NumberField或TextField不能处理KeyPress问题

    博客分类:
  • EXT
EXT 
阅读更多

keyup,keydown,keypress,都试试,当初郁闷了我很久。

Form控件的
NumberField (或TextField)不能获取键盘事件,可以试试以下方法。

    var barcode = new Ext.form.NumberField({
        allowDecimals: false,
        decimalPrecision: 0,
        allowNegative: false,
        selectOnFocus: true,
        allowBlank: true,
        applyTo: 'txtCard',
        emptyText: '- Scan -'
    });

    Ext.get(barcode.el).on('keyup', function(e) {
    //do something
  }

分享到:
评论
2 楼 bivin0603 2012-03-27  
楼上正解,支持
1 楼 arthur_jiang 2010-09-01  
This event only fires if enableKeyEvents is set to true.

API的说明里有这么一句.看楼主的代码好象少了enableKeyEvents的设置.

相关推荐

Global site tag (gtag.js) - Google Analytics