View Full Version : LIST: Get selected index on swipe  10 May
2012, 4:38 AM I'm trying to get the selected of a list when you
swipe it. I'd like to make sure the list item is selected before
executing a function on the list item but I can't for the life
of me figure out how to do this! Here's my code, please help!!!!
xtype: 'list', flex: 1, indexBar: true, itemTpl: '{city}
{name}', store: 'TeamStore', id: 'TeamsList', items: [ xtype:
'toolbar', docked: 'bottom', height: 49, cls: 'z-tabbar', items:
[ {xtype: 'searchfield', name: 'teamSearch', placeHolder:
'Search', centered: true, width: '95%'} listeners: { itemswipe:
function (list, idx, target, record, evt) {  var selected =
list.getActiveItem(); if (!selected) { return; }  var
selectedIndex = selected[0]; console.log([selectedIndex, idx]);
Ext.Msg.alert('itemswipe', idx);  } // itemswipe } // listeners
14 May 2012, 5:44 AM I'm curious why you tried getActiveItem()
to get the selected?  To get the selection you should use
getSelection() instead  14 May 201