這是我的網格列KEYUP,按鍵事件不火的ExtJS的GRD列
MyColumn3Ui = Ext.extend(Ext.grid.NumberColumn, {
constructor: function(cfg) {
cfg = cfg || {};
MyColumn3Ui.superclass.constructor.call(this, Ext.apply({
dataIndex: 'ID',
header: 'name',
sortable: true,
width: 75,
align: 'right',
id: 'name_col',
editor: {
xtype: 'numberfield',
name: 'ID',
decimalPrecision: 0,
allowDecimals: false,
enableKeyEvents: true,
allowBlank: false,
maxLength: 5,
id: 'col_id'
}
}, cfg));
}
});
這是我嘗試火KEYUP和按鍵事件
this.col = Ext.getCmp('col_id');
this.col.blur = blurFun .createDelegate(this, [this.col, 4,""]);
this.col.keyup = keyupFun.createDelegate(this, [this.col, 4,""]);
this.col.keypress = keypressFun .createDelegate(this, [this.col, 4,""]);
blurFun = function(txtField, length, nextField) {
alert('blur');
}
keyupFun= function(txtField, length, nextField) {
alert('keyup ');
}
keypressFun = function(txtField, length, nextField) {
alert('keypress');
}
當我的名字列中單擊只顯示blur
警報。其他事件在我可編輯的ExtJs網格中不會觸發。我想爲火KEYUP,在我的網格列
你必須添加「enableKeyEvents:真正的」配置您的文本字段用於綁定的關鍵事件。 –
感謝您的幫助我檢查enableKeyEvents:true作爲我的新更改代碼它不適用於我 – Duleep