EasyUI Forum
September 13, 2025, 11:06:04 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: How to enable or remove menu item in easyui ribbon  (Read 10280 times)
Vilisag
Newbie
*
Posts: 16


View Profile
« on: December 08, 2014, 06:56:35 PM »

Hi all,
 I use easyui ribbon in my project, but I don't know how to enable or remove menu item in easyui ribbon.
 Please help me, thank for help.
Logged
jarry
Administrator
Hero Member
*****
Posts: 2298


View Profile Email
« Reply #1 on: December 08, 2014, 08:20:40 PM »

To disable a menu item, set the 'disabled' property to true.
Code:
tools:[{
id:'btn-clipboard',
type:'splitbutton',
name:'paste',
text:'Paste',
iconCls:'icon-paste-large',
iconAlign:'top',
size:'large',
menuItems:[{
name:'paste',
text:'Paste',
disabled:true,
iconCls:'icon-paste'
},{
name:'paste-special',
text:'Paste Special...',
iconCls:'icon-paste'
}]

To enable or disable a menu item programmatically, get the menu object first and then call 'enableItem' or 'disableItem' methods to enable or disable the specified menu item. The code below shows how to enable the 'Paste' menu item.
Code:
var m = $('#btn-clipboard').splitbutton('options').menu;  // get the menu object
var item = m.menu('findItem', 'Paste');  // find the menu item
m.menu('enableItem', item.target);  // enable it
Logged
Vilisag
Newbie
*
Posts: 16


View Profile
« Reply #2 on: December 09, 2014, 01:17:47 AM »

Thanks jarry!!
Logged
Vilisag
Newbie
*
Posts: 16


View Profile
« Reply #3 on: May 31, 2015, 06:30:38 PM »

Thanks jarry!! Menu item has been disabled but when i clicked item, it stilled call function. 
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!