Search code examples
listviewsencha-touchextjsmobile-website

Firing onItemDisclosure event causes itemtap event to fire


i am trying to handle to events on the same list , the first is the itemtap event and the other is the onItemDisclosure event.

When i tap on the arrow , the onItemDisclosure event is fired and handler is executed , however , the itemtap is fired as well , and after the onItemDisclosure handler executes , the itemtap handler is in turn 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');
},

Solution

  • onItemDisclosure is a property of Ext.List - not an event. In controller's control, we use events. So, here you will need disclose event similar to "itemtap" event. Check this link.