Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4021 Lượt xem

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

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

     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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 9 15
8889
2
thg 8 15
5260
0
thg 8 15
3074
1
thg 3 15
388
2
thg 3 15
411