EasyUI Forum
June 25, 2024, 03:45:17 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 disable contextmenu  (Read 12144 times)
yogesh
Newbie
*
Posts: 47


View Profile Email
« on: July 17, 2012, 06:04:44 AM »

Hi,

 i want to disable some items in context menu runtime how to achine this using this framework

example


<div id="mm" class="easyui-menu" style="width: 120px;">
        <div  id="mm1" onclick="">
            menu1</div>
             <div  onclick="">
            menu2</div>
        <div onclick="menu3">
           menu3</div>
        <div onclick="menu4">
            menu4</div>
       
    </div>

i want to disable menu 1 and 3 how to achieve this
Logged
tomhj
Newbie
*
Posts: 40


View Profile
« Reply #1 on: July 17, 2012, 10:12:12 AM »

Check the documentation for the menu widget.  There is a disableItem() method you can use
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #2 on: July 17, 2012, 01:58:03 PM »

i saw that but i am unable to implement that there is no example of that
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: July 17, 2012, 08:29:43 PM »

Call 'findItem' method to find the menu item and then call 'disableItem' method to disable that menu item.
Code:
var m1 = $('#mm').menu('findItem','menu1');
$('#mm').menu('disableItem', m1.target);
var m3 = $('#mm').menu('findItem','menu3');
$('#mm').menu('disableItem', m3.target);
Logged
yogesh
Newbie
*
Posts: 47


View Profile Email
« Reply #4 on: July 18, 2012, 03:47:03 AM »

thats gr8 !!!

its working !!
thank you Smiley
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!