PDA

View Full Version : Tap event in a Panel



aguerra10
5 Jan 2012, 7:03 AM
Hi,


I am trying to catch a tap event on a panel but I can't get it work. I am using Sencha Touch PR 2.
Could someone help me and let me know if I am doing anything wrong?

Thanks!!!


Here is my code:



{
xtype: 'panel',
id: 'myId',
height: 120,
layout: {
type: 'hbox',
align: 'stretch'
},
items: [
{
width: 130,
height: 120,
listeners: {
afterrender: function(c){
c.el.on('click', function(){
console.log ('click');
});
c.el.on('tap', function(){
console.log ('tap');
});
}
}
},
{
flex: 1,
height: 120,
}
]
}

mitchellsimoens
5 Jan 2012, 8:22 AM
There is no afterrender event. You should use the painted event.

aguerra10
5 Jan 2012, 8:31 AM
There is no afterrender event. You should use the painted event.

Great!! I'll try it.

Thanks Mitchell !!

aguerra10
5 Jan 2012, 8:35 AM
It worked!! I do appreciate your help mitchellsimoens!!