工具栏菜单溢出中的链接按钮在同一窗口中打开,下面的示例代码


Ext.application({
    name: 'Toolbar overflow example',
    launch: function() {
        var addedItems = [];
        Ext.create('Ext.toolbar.Toolbar', {
            renderTo: document.body,
            id: 'toolbarId',
            width: 500,
            overflowHandler: 'menu',
            items: [{
                text: 'link button 1',
                href: 'www.google.com',
                width:100,
            }, {
                text: ' button 1',
                 width:100,
            }, {
                text: ' button 2'
            }, {
                text: 'button 3 '
            }, {
                text: 'button 4'
            }, {
                text: 'link button 1',
                href: 'www.yahoo.com',//this link is opened in same window
            }]
        });
    }
});

定义链接按钮,如下所示:

{
    href: 'http://google.com',
    text: 'Link Item 4',
    hrefTarget: '_blank'
}

工作小提琴

最新更新