ExtJS中listener方法和handler方法的区别
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了ExtJS中listener方法和handler方法的区别,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含1369字,纯文字阅读大概需要2分钟。
内容图文
listener方法和handler方法的区别在文档中的说明的太玄乎了,看不懂
listeners监听能够对一个click Event事件添加任意多个的事件响应处理函数
而handler处理只能够通过处理函数一次处理点击响应
Ext.create(‘Ext.Button‘, { text : ‘Dynamic Handler Button‘, renderTo: Ext.getBody(), handler : function() { // this button will spit out a different number every time you click it.// so firstly we must check if that number is already set:if (this.clickCount) { // looks like the property is already set, so lets just add 1 to that number and alert the userthis.clickCount++; alert(‘You have clicked the button "‘ + this.clickCount + ‘" times.\n\nTry clicking it again..‘); } else { // if the clickCount property is not set, we will set it and alert the userthis.clickCount = 1; alert(‘You just clicked the button for the first time!\n\nTry pressing it again..‘); } } });
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‘); } }, dblclick: { element: ‘body‘, //bind to the underlying body property on the panel fn: function(){ console.log(‘dblclick body‘); } } } });
-------------------------------------------------------------------------------------------------------------------------------------------
原文:http://www.cnblogs.com/gwcyulong/p/7182919.html
内容总结
以上是互联网集市为您收集整理的ExtJS中listener方法和handler方法的区别全部内容,希望文章能够帮你解决ExtJS中listener方法和handler方法的区别所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。