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

时间:2016-02-15 12:10:38

标签: extjs

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
            }]
        });
    }
});

1 个答案:

答案 0 :(得分:1)

定义链接按钮,如:

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

Working fiddle