PDA

View Full Version : How to open button menu



mcadirci
20 Sep 2010, 5:17 AM
Hello,
I have a button with a menu.

When I click the button, open menu and select one of the elements the menu is closed?

How can I prevent menu from close or how can I reopen the menu?

Here is my button:
{
xtype: 'button',
text: '<fmt:message key="Show"/>',
icon:'<c:out value="${pageContext.request.contextPath}"/>/icons/magnifier.png',
menu: [
{
text: '<fmt:message key="AltTextStoppedVehicles"/>',
checked: false,
checkHandler: onItemCheck
},
{
text: '<fmt:message key="AltTextMovingVehicles"/>',
checked: false,
checkHandler: onItemCheck
},{
text: '<fmt:message key="AltTextIdleVehicles"/>',
checked: false,
checkHandler: onItemCheck
},
{
text: '<fmt:message key="AltTextViolationVehicles"/>',
checked: false,
checkHandler: onItemCheck
},
{
text: '<fmt:message key="AltTextVehiclesInRegion"/>',
checked: false,
checkHandler: onItemCheck
},
{
text: '<fmt:message key="AltTextVehiclesOutOfRegion"/>',
checked: false,
checkHandler: onItemCheck
},
{
text: '<fmt:message key="AltTextVehiclesWithNoData"/>',
checked: false,
checkHandler: onItemCheck
}
]
}
Here is my item check function:

function onItemCheck(item, checked){
item.parentMenu.????????
if( item.text == '<fmt:message key="AltTextStoppedVehicles"/>' ){
stopFilter = checked;
}else if( item.text == '<fmt:message key="AltTextMovingVehicles"/>' ){
moveFilter = checked;
}else if( item.text == '<fmt:message key="AltTextIdleVehicles"/>' ){
idleFilter = checked;
}else if( item.text == '<fmt:message key="AltTextViolationVehicles"/>' ){
violationFilter = checked;
}else if( item.text == '<fmt:message key="AltTextVehiclesInRegion"/>' ){
inRegionFilter = checked;
}else if( item.text == '<fmt:message key="AltTextVehiclesOutOfRegion"/>' ){
outOfRegionFilter = checked;
}else if( item.text == '<fmt:message key="AltTextVehiclesWithNoData"/>' ){
noDataFilter = checked;
}
}

Thanks.

--
Mehmet

Animal
20 Sep 2010, 5:26 AM
http://dev.sencha.com/deploy/ext-3.3-beta1-6976/docs/?class=Ext.menu.BaseItem&member=hideOnClick

mcadirci
20 Sep 2010, 5:29 AM
Thank you very much Animal, I though I should handle that from the parentMenu item.

Animal
20 Sep 2010, 5:43 AM
http://dev.sencha.com/deploy/ext-3.3-beta1-6976/docs/?class=Ext.Container&member=defaults

loeischandra
31 Jan 2013, 12:45 AM
i have similar problem in extjs 4
and still confusing until now

i want to show submenu on click instead of hover??

willigogs
31 Jan 2013, 2:46 AM
i have similar problem in extjs 4 and still confusing until now

I want to show submenu on click instead of hover??
I would recommend asking in the EXT4 menu:
http://www.sencha.com/forum/forumdisplay.php?81-Ext-Discussion