EasyUI Forum
September 14, 2025, 03:57:43 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: disable menubutton mouseover  (Read 9694 times)
Toldry
Newbie
*
Posts: 3


View Profile Email
« on: February 17, 2014, 08:18:03 AM »

Is there a way for me to disable a menubutton so that when I put my mouse over it, it won't show the submenu?
or do i have to manually unbind the 'mouseover' event of the menubutton?

thank you
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 17, 2014, 05:42:29 PM »

Please call 'disable' method to disable a menubutton component.
Code:
$('#mb').menubutton('disable');
Logged
Toldry
Newbie
*
Posts: 3


View Profile Email
« Reply #2 on: February 18, 2014, 07:46:55 AM »

Please call 'disable' method to disable a menubutton component.
Code:
$('#mb').menubutton('disable');

this works for the main menubutton (the <a> element) but not for the menu(the <div> element)


EDIT: I found that 'menu' has the method 'disableItem' , but I can't use the method because the menus get attached to the <body> and I can't use the jquery $ selector to get the correct menu.

Do I have to give every menu an ID so that I can know which menu is which, or is there a way for me to create the menus without attaching them to the <body>?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: February 19, 2014, 01:21:05 AM »

Get the menu binded to menubutton and you can do anything with this menu.
Code:
var opts = $('#mb').menubutton('options');  // the menubutton options
var m = $(opts.menu);  // the menu object
var item = m.menu('findItem', 'Copy');  // find the menu item
m.menu('disableItem', item.target);  // disable the specified menu item
Logged
Toldry
Newbie
*
Posts: 3


View Profile Email
« Reply #4 on: February 20, 2014, 01:07:18 AM »

Get the menu binded to menubutton and you can do anything with this menu.
Code:
var opts = $('#mb').menubutton('options');  // the menubutton options
var m = $(opts.menu);  // the menu object
var item = m.menu('findItem', 'Copy');  // find the menu item
m.menu('disableItem', item.target);  // disable the specified menu item

How does 'findItem' work? what do I need to put in the 2nd parameter for it to find the right menu?
Is it possible to use 'findItem' by giving it an object that I have in my system that is attached to the menu item?
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!