views:

119

answers:

2

I'm trying to do a Tabpanel in Sencha Touch and add a handler to one of the buttons, but the event doesn't fire when I click it. Any ideas?

Here is the code:

The handler:

var handler = function(button, event) {
        var txt = "YES!";
        alert(txt);
    };

And the item:

items: [{
        xtype: 'button',
        title: 'Test',
        html: 'Test',
        iconCls: 'info',
        cls: 'card1',
        handler: handler
    }]
A: 

Add after items:

listeners: {
        cardswitch : function() {
          console.log('cardswitch!');
        }
}

See docs http://dev.sencha.com/deploy/touch/docs/?class=Ext.TabBar

beshkenadze