PDA

View Full Version : (newbie): Is it possible to load an handler via bottom tabpanel?



savelee
14 Oct 2010, 3:04 AM
Hi there,
I'm new with Sencha Touch & Ext JS and I have a (simple?) question..
Is it possible to load an prompt / or put an handler in a tabpanel?
Cause what I tried did not work:



test.Container = {

/**
* Variable to hold class object
* @return {Object}
*/
classObj : test.Container,

setLayout:function(){

var tabpanel = new Ext.TabPanel({
activeItem: 0,
animation: {
type: 'cardslide',
cover: true
},
cls: 'interface',
dockedItems: [{
cls: 'topbar',
dock: 'top',
ui : 'light',
xtype: 'toolbar',
title : 'Test',
items:[{
xtype:'button',
iconMask: true,
text : 'About',
ui:'action',
handler : function(){
console.log("home");
}
}]
}],
defaults: {
scroll: 'vertical'
},
fullscreen: true,
layout: 'hbox',
items: [
{
cls: 'tab-home',
iconCls: 'home',
items: [test.Home],
title: 'Home'
},
{
cls: 'tab-settings',
iconCls: 'settings',
handler: function() {
Ext.Msg.prompt('Welcome! What s your first name?', Ext.emptyFn);
},
title: 'Settings'
},
{
badgeText: '3',
cls: 'tab-fav',
iconCls: 'favorites',
items: [test.Favourites],
title: 'Favorites'
},
{
cls: 'tab-categories',
iconCls: 'download',
items: [test.Categories],
title: 'Categories'
}
],
ui: 'dark',
tabBar: {
cls: 'bottombar',
dock: 'bottom',
layout: {
pack: 'center'
}
}
});
},
onAboutButton:function() {
console.log("clicked on about button");
}
};

jay@moduscreate.com
14 Oct 2010, 5:17 AM
I don't see where you're setting a handler for "onAboutButton". Are you just trying to add a button that does not flip a card?

savelee
14 Oct 2010, 5:29 AM
no it's not the about button. but the settings button for where i was wondering.
But I guess I found it.

I should do it with a listener:


listeners : {
activate : function(){ .. }
}

right?