Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
140
Contextmenu Items set_visible
posted

hello,

I use the component WebDataMenu Context Menu mode.
I linked the event GridMousDown to display the menu on a webdatagrid.
I test in javascript if the click is located on a line or off depending on the case and I hides menu items or not.
The problem is that when I face one items, the menu background does not resize. Is there a solution for this?

here is my javascript code in case I hide items:

             var menu = $ find ("<%= this.ContextMenuGrid.ClientID %>");

            
for (i = 0; i <= menu.getItems (). get_length () - 1, i + +) {
                
if (menu.getItems (). getItem (i). get_key () == "Delete") {
                    
menu.getItems (). getItem (i). set_visible (false);
                
}
                
else if (menu.getItems (). getItem (i). get_isSeparator () == true) {
                    
menu.getItems (). getItem (i). set_visible (false);
                
}
                
else {
                    
menu.getItems (). getItem (i). set_visible (true);
                
}
            
}

            
if (menu! = null & & eventArgs.get_browserEvent ()! = null & & eventArgs.get_browserEvent (). button == 2) {
                
menu.showAt (null, null, eventArgs.get_browserEvent ());
            
}

Thank you for your help

Parents Reply Children
No Data