Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4285 Представления

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
1
сент. 15
9182
2
авг. 15
5559
0
авг. 15
3326
1
мар. 15
661
0
мар. 15
379