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
}