简体   繁体   中英

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

if I press the decline button it should removes the item from the list, but if I press the area around the button I should see the office detail

看屏幕

you have to include the event.stopEvent() inside the button tap handler. that is it. :)

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 
},

or if you have the listener inside the view

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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