Set active menu item inside menu

Viewed 3563

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);
});
2 Answers
Related