簡體   English   中英

想要禁用子菜單extjs上的右鍵單擊事件

[英]Wants to disable right click event on submenu, extjs

我也有一個包含子菜單的菜單。 想要禁用右鍵單擊事件

在菜單上它正在工作。 我的意思是,如果我單擊鼠標右鍵,則什么也沒有發生,但同樣沒有申請子菜單

試過了

{
    text: 'Tools',
    name: 'toolsBtn',
    id:'toolsmenu',
    disabled:true,
    menu: new Ext.menu.Menu({
        id:'menutoolbar',
        items: [{
            text: 'Select some row from the results grid',
        }],
        listeners: {
            render : {
                fn : function(item) {
                    var el = item.getEl();
                    this.el.on("contextmenu", Ext.emptyFn, this, {preventDefault: true});
                }
            }
        }
    })
}

它在菜單上起作用,但在子菜單上不起作用

只需在子菜單上添加相同的偵聽器即可:

items: [{
        text: 'Select some row from the results grid',
        listeners: { //your listener
        }
    }]

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM