Sencha Fiddle for the code below: https://fiddle.sencha.com/#fiddle/1t1
Ext.application({
name: 'listview',
launch: function() {
var popup = Ext.create('Ext.Panel', {
html: 'popup',
hideOnMaskTap: true,
modal: true
});
Ext.Viewport.add({
xtype: 'list',
fullscreen: true,
itemTpl: '{name}',
data: [{
name: 'item 1'
}, {
name: 'item 2'
}, {
name: 'item 3'
}],
listeners: {
itemtap: function(list, itemIndex, target) {
popup.showBy(target, 'tc-bc');
}
}
})
}
});
What you might have overlooked is the itemtap
event callback signature. The first parameter is the list, not the listitem.
The second argument of the showBy
method describes the alignment. tc-bc
means top center of the popup should align with the bottom center of the showBy target.
See http://docs.sencha.com/touch/2.2.1/#!/api/Ext.Component-method-showBy