I have a button that once clicked, will expand a menu item, I want to be able to click one of those menu items programmatically through the java script console. Here's what i have for clicking the button, but need a little help on clicking the Ext.menu.Menu
var fireButton=Ext.ComponentQuery.query('button[itemId=buttonID]')[0]; //find button id
fireButton.fireEvent('click'); //open button/submenu
var ok = Ext.ComponentQuery.query('menuitem')[0]; //excess menu item
//how to click a menu item??
here's my menu:
menuButton: new Ext.menu.Menu({
items: [
{text: 'OK', value: 'ok'},
{text: 'Next', value: 'next'},
],
listeners: {
click: 'onClickMenuButton',
}
onClickMenuButtonItem: function(menu, item){
this.makeVisible(menu, item);
},
makeVisible: function(menu, item){
var menuItem = Ext.getCmp(item.value);
menuItem.isVisible()){
menuItem.setVisible(false);
item.setIconCls('plusSign');
}),
var openMenu = Ext.ComponentQuery.query('button[itemId=buttonID]')[0];
openMenu.fireEvent('click', openMenu);
var clickMenu = Ext.ComponentQuery.query("menu")[0]
clickMenu.items.filter('text','OK').fireEvent('click'); //Don't work!
$('.sub-menu-open .item').eq(itemId).find('a').trigger('click');
– evolutionxbox