+ -
当前位置:首页 → 问答吧 → 急!关于extjs问题,怎么在extjs文本框中增加onkeyup事件?

急!关于extjs问题,怎么在extjs文本框中增加onkeyup事件?

时间:2011-08-22

来源:互联网

RT!
实在不会了,网上说用:
form_panel.findById('text_id').getEl().dom.attachEvent('onkeyup',function method_name(){
  alert();
});
不过会报错,说找不到对象,请各位大侠们帮帮小弟,部分代码如下:

var txm_panel = new Ext.FormPanel({
border : false,
baseCls : 'x-plain',
bodyStyle : 'padding:5px 5px 0',
labelAlign : 'right',
labelWidth : 70,
frame:true,
defaultType : 'textfield',
items : [{
fieldLabel : '流水单号',
id : 'formCode'
}],
buttonAlign : 'center',
minButtonWidth : 60,
buttons: [
{
text: "确定",
handler: function()
{
alert();
}
}]
});
txm_panel.findById('formCode').getEl().dom.attachEvent('onkeyup',function sjf(){
alert();
});

作者: qw1424   发布时间: 2011-08-22

<intput type="text" id="txt">

Ext.get("txt").on("onkeyup", function() {
  alert("onkeyup");
});

作者: softroad   发布时间: 2011-08-22

帮顶下

作者: ruiru89521   发布时间: 2011-08-22

正在学习中帮顶

作者: xiaofeng1354   发布时间: 2011-08-22

热门下载

更多