您的位置:首页 > 其它

为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
}
}
]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: