PDA

View Full Version : Context Menu How to hide sub menu ?



daniel_r
31 Mar 2011, 12:58 AM
First of all Im new to ExtJs and it looks really powerfull ...
Hi I got a context menu with several items
one of the items look like this:


{
text : t.move,
menu : {
plain : true,
listeners : {
beforeshow : {
fn : this.populateMoveMenu,
scope : this
}
}
}
},


In populateMoveMenu : function(menu) {

if condition is not meet i want to hide the submenu

I tried menu.hide() , but it doesn't do a thing (tired doHide() and destroy() also)

And a thin submenu (cause its empty) line is seen...

How can I remove this thin line?

Thanks Ahead,

Daniel.

daniel_r
2 Apr 2011, 11:58 PM
Any1?

mankz
3 Apr 2011, 2:13 AM
It's all described in the api docs of the Menu class beforeshow event. http://dev.sencha.com/deploy/dev/docs/?class=Ext.menu.Menu

Return false to stop the show action :)