0

单击选项卡时是否有可能获得事件?

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谷歌翻译,对不起。

4

1 回答 1

0

按钮数组中的每个项目都是选项卡,它是按钮的继任者,因此具有“处理程序”属性:

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

    }, {
        title: 'Search',
        iconCls: 'search'
    }
];
于 2011-05-13T20:54:06.237 回答