Dismissing the onItemDisclosure event raises the itemtap event to fire

I am trying to handle events in one list, the first is the itemtap event, and the other is the onItemDisclosure event.

When I click on the arrow, the onItemDisclosure event is fired and the handler is executed, however the itemtap is also fired, and after the onItemDisclosure handler is executed, the itemtap handler is executed.

How can i solve this?

View:

Ext.define('myapp.view.listview', {   
    requires: [ 'myapp.model.listmodel'],
    extend: 'Ext.List',
    alias:'widget.listview',  
    id : 'listview',
    fullscreen: true,  
config: {

    iconCls: 'list',


    title : 'List',
    onItemDisclosure: function () {
    alert('ok')

    },               

    store:'ListView',  
    itemTpl:'{title}'   


  }
 });

Controller Code:

 Ext.define('myapp.controller.Main', {  
     extend: 'Ext.app.Controller',
    views : ['listview'],
    config : {


    refs:{

        list:'#listview'


    },
    control :{



        listview:{
            itemtap:'display',
            onItemDisclosure : 'disclosure'
        }






    }
},


display:function(){
   alert('tap')
},




disclosure:function (){
    alert('disclosure');
},
+5
source share
2 answers

onItemDisclosure- The Ext.List property is not an event. In the controller controlwe use events. So, here you need to expose an event similar to the itemtap event. Check out the link.

0
source

itemtap, . , stopEvent().

disclosure: function(list, record, node, index, event, eOpts) {
    console.log('disclose');        

    event.stopEvent();
},
+9

All Articles