繁体   English   中英

当我点击项目列表内的按钮时,停止itemtap事件;如果在按钮外的任何地方按一下,则保持itemtap事件

[英]Stop the itemtap event when I tap in a button which is inside the item list, and keep the itemtap event if I press anywhere outside the button

如果我按下拒绝按钮,它应该从列表中删除该项目,但是如果我按下按钮周围的区域,我应该会看到办公室的详细信息

看屏幕

您必须在按钮点击处理程序中包含event.stopEvent()。 这就对了。 :)

declineRequestButtonTap: function (self,event) {
  console.log('decline button tap functionality'); //your code 
  event.stopEvent(); //this stops the itemtap event  
},
onRequestItemTap: function (list, idx, el, record) {
  console.log('I didn't press the button I pressed anywhere out of the button but inside the item list.') //your code 
},

或者如果您在视图内有监听器

    xtype: 'button',
    flex: 1,
    text: 'decline',
    ui: 'decline',
    listeners: {
      tap: function (self,event) {
        //your code 
        event.stopEvent();
      }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM