为Ext.form.Panel的xtype:label添加事件
2017-11-27 18:09
429 查看
需求
在Ext.form.Panel中添加文字,并注册click事件。实现如效果图所示的功能
效果图
\
核心
为xtype:label添加事件listeners: { render: function () {//渲染后添加click事件 Ext.select("#pipeSecrecyAgreement").on('click', function (e, t) { agreementWin.show(); }); }, scope: this }
代码
items:[ { xtype:"checkbox", id:"optionAgreement", width:30, height:30, margin:"10 0 0 650", handler: function() { } }, { xtype: "label", id:"pipeSecrecyAgreement", width: 150, height: 30, text: '同意管线保密协议', margin: " 10 0 0 0", border: 0, style: "text-decoration: underline;color:red;", listeners: { render: function () {//渲染后添加click事件 Ext.select("#pipeSecrecyAgreement").on('click', function (e, t) { agreementWin.show(); }); }, scope: this } } ]
相关文章推荐
- Ext FormPanel监听键盘按钮事件
- extjs ext.tree.panel 添加监听事件
- Ext formpanel 动态添加 表单 的一种实现方法
- Ext 中,为Ext.form.HtmlEditor添加键盘事件
- 向ext的form表单元素添加click监听事件
- Ext 中,为Ext.form.HtmlEditor添加键盘事件
- Ext 中,为Ext.form.HtmlEditor添加键盘事件
- ExtJs内的Ext.form.Panel中datefield控件选择日期过后的事件监听select以及比较两个时间的大小
- Ext 为label添加单击事件
- Ext JS表单Ext.form.FormPanel
- ExtJs2.0学习系列(4)--Ext.FormPanel之第一式
- ext:GridPanel 事件觸發
- Ext.FormPanel多列显示的问题
- 动态设置Ext.form.FormPanel控件里子控件的显示和隐藏
- ext FormPanel的创建
- Ext Window & FormPanel Component Demo
- ExtJs2.0学习系列(6)--Ext.FormPanel之第三式(ComboBox篇)
- Panel 上添加了很多control,如何避免Panel的click事件被拦截
- cocos2d-x之为label添加事件监听器,单点触摸
- Ext.form.FormPanel表单提交