-1

Can anybody tell How to implement listview item tap event in controller in sencha touch

Thanks

user386430
  • 4,837
  • 13
  • 41
  • 45

1 Answers1

1

Do the following: If your list is like below:

{
  xtype: 'list',
  name: 'myList',
  store: 'test'
}

Then your controller will go like this:

config: {
    refs: {
        myList: 'list[name="myList"]'
    },
    control: {
        myList: {
            itemtap: 'onItemTap' // fires when listitem is tapped
        }
    }
},

onItemTap: function(view, index, target, record, event) {
    console.log('List Item was tapped of the list view');
    ........ your code goes here .........
}

Note: These small things you can find in sencha docs.

Anand Gupta
  • 5,640
  • 3
  • 27
  • 37