extjs 下拉菜单创建,里面有 link

extjs dropdown menu creation with link inside

我正在尝试为其中的每个按钮创建一个下拉菜单,link 到一个页面。 我编写了以下代码,但无法在内部创建一些 link,每次都会出错:

Ext.create('Ext.menu.Menu', {
layout: 'hbox',
width: 500,
height: 40,
margin: '10 0 0 10',
renderTo: Ext.getBody(),
floating: false,
items: [{
    text: 'Home'
},
{
    text: 'Inventory',
    menuAlign: 'tr-br',
    menu:{
        items:[
            {
                text: 'Show',
            },
            {
                text: 'Search'
            },
            {
                text: 'Service Catalog'
            }
        ]
    }
},
{
    text: 'Request',
    menuAlign: 'tr-br',
    menu:{
        items:[
            {
                text: 'New Request'
            },
            {
                text: 'My requests'
            }
        ]
    }
},
{
    text: 'Management',
    menuAlign: 'tr-br',
    menu:{
        items:[
            {
                text: 'Sites'
            },
            {
                text: 'Users'
            },
            {
                text: 'Stocks'
            },
            {
                text: 'Export'
            }
        ]
    }
},
]
});

有谁知道如何在按钮中创建 link 吗?

找到解决方案:

我刚刚在我的代码中添加了一个处理程序:

            {
                text: 'Search',
                handler : menuH
            },

和处理程序:

var menuH = function() {
window.location = "/myapplication";
}