Search code examples
sencha-touch-2

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

see the screen


Solution

  • 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();
          }