Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set active menu item inside menu

I am trying to dynamically set an active item inside a menu as if it was selected. Browsing through the documentation I could not found a solution. I am trying to this while rendering the whole menu.

caseListStore.each(function(n) {

        var menuItem = new Ext.menu.Item({
            text: rec.data.name,
            value: rec.data.url,

        });

        if (rec.data.name == "someCondition)" 
           menuItem.setActive();     //not working

        casesMenu.add(menuItem);
});
like image 595
Jacob Avatar asked Nov 26 '22 08:11

Jacob


1 Answers

Have you tried using setDisabled?

    menuItem.setDisabled(true);

If you are using ExtJS 3.4, please use the disable function.

     menuItem.disable();
like image 191
user820688 Avatar answered Dec 04 '22 05:12

user820688