Ext.TabPanel项目处理程序

时间:2010-10-12 14:20:48

标签: events handler tabbar sencha-touch

单击选项卡时是否有可能获得活动?

var buttons = [
    {
        title: 'Home',
        iconCls: 'home'
    }, {
        title: 'Search',
        iconCls: 'search'
    }
];

var panel = new Ext.TabPanel({
        fullscreen: true,
        cls: 'panel',
        ui: 'dark',
        tabBar: {
                    dock: 'bottom',
                    layout: {
                       pack: 'center'
                    },
                },
        items:buttons
    });

PS Google Translte,抱歉。

1 个答案:

答案 0 :(得分:0)

按钮数组中的每个项目都是Tabs,这是一个Button后继者,因此具有“handler”属性:

var buttons = [
    {
        title: 'Home',
        iconCls: 'home',
        handler: function(button, event) {
             alert("Button " + button.getText() + " clicked!");
        }

    }, {
        title: 'Search',
        iconCls: 'search'
    }
];