label自身并无单击事件,需要手动添加监听,触发单击事件

//在ui界面创建好lable控件

 var label = new Ext.form.Label({ 

          itemId: 'addClick',
                height: 20,
                margin: '13 0 7 0',
                text: '单击测试',
                style: 'color:blue;cursor:pointer;text-decoration:underline;'});

//向label中添加监听器,单击执行指定的函数

label.addListener("click", function () {

  alert('do clickEvents');

},null,{ element: 'el' });

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-28
  • 2022-12-23
  • 2021-08-26
  • 2022-02-12
  • 2021-06-05
相关资源
相似解决方案