View Full Version : How to get the click or tap event working on a Ext.Panel ?

22 Nov 2011, 7:28 AM
Hello, I tried this and other solutions, but I don't see the alert box showing up.
Am I doing it wrong? I used the sencha-touch-all.js

Regards, Chris.

name: 'Sencha',

launch: function() {

//this is the Panel we'll be adding below
var aboutPanel = Ext.create('Ext.Panel', {
html: 'About this app'


var otherPanel = Ext.create('Ext.Panel', {
html: 'Another Panel'

//this is the Panel we'll be adding to
var mainPanel = Ext.create('Ext.Panel', {
fullscreen: true,

layout: 'hbox',
defaults: {
flex: 1

items: {
html: 'First Panel',
style: 'background-color: #5E99CC;'



aboutPanel.addListener('click', function(){alert('click'), this });

22 Nov 2011, 7:56 AM
welcome to the community chrismobile.

first, please choose one of the correct forums to write questions to.
i can assume that you are using Sencha Touch 1 or 2, but this already makes a big difference. If you are using the 1 / 2 Q&A forums, you will get more views and probably faster and better help.

to your problem: you can only listen to the events of any ext component / container, that are specified in the API docs. "click" is an event for a dom node, that can not be directly put on a JS construct.


should already help. and please use code tags, since they preserve the formatting of code.

24 Nov 2011, 5:09 AM
Thank you for your time and reply, This was my first post as I am complete new to the sencha framework. It's a really great framework!

I will post my questions from now on in the right forum topic!