コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
3754 ビュー

Hello,

how to get the value of the text in the selected menu in the topbar menu item ? for eg when i click on sales i have sales, when i click on Events i have events

アバター
破棄
最善の回答

     In the web/static/src/js/chrome.js File
    using the below code to read name

    menu_click: function(id, needaction) {
        if (!id) { return; }
        /* To Read Menu Name */
        var func = new instance.web.Model("ir.ui.menu").get_func("read");
            func(id,["name"]).then(function(res) {        
            var menu_name = res['name'];        
            alert(menu_name);
        /* End */        
        });
        /* Other Code */
    },
    
    Best way in custom module to override js code and get name

アバター
破棄
関連投稿 返信 ビュー 活動
1
9月 15
8576
2
8月 15
5015
0
8月 15
2803
1
3月 15
97
2
3月 15
133