
有两种方法
通过文本框textfield的配置项listeners进行配置
eg:
new Ext.panel.Panel({
width: 400,
height: 200,
dockedItems: [{
xtype: 'toolbar'
}],
listeners: {
click: {
element: 'el', //bind to the underlying el property on the panel
fn: function(){ console.log('click el')}
}
}})
eg:
me.down('textfield[name=这里是你文本框的名称]').on('click',点击的响应函数,me)
ps:
me.down('button[action=viewElementDetails]')获得textfield组件对象,on('click',点击的响应函数,me)添加事件click事件
可以使用:keydown事件keydown()
输入字段键盘下降时的事件。该事件只会在enableKeyEvents为...
输入字段键盘下降时的事件。该事件只会在enableKeyEvents为true时有效。Keydown input field event. This event only fires if enableKeyEvents is set to true.
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)