Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:54:39+00:00 2026-05-26T03:54:39+00:00

For my asp.net mvc 3 application I’m using this plugin . But I have

  • 0

For my asp.net mvc 3 application I’m using this plugin. But I have a problem, I want to enable or disable some menu items, after I have created the menu, like:

    <script type="text/javascript">
    $(function(){
        /**************************************************
         * Menu 1
         **************************************************/
        $.contextMenu({selector: '.context-menu-one', items: {
            edit: {name: "Edit", icon: "edit", callback: $.noop, accesskey:"e d i t"},
            cut: {name: "Cut", icon: "cut", callback: $.noop, accesskey:"c u t"},
            copy: {name: "Copy", icon: "copy", callback: $.noop, accesskey:"c o p y"},
            paste: {name: "Paste", icon: "paste", callback: $.noop, accesskey:"p a s t e"},
            "delete": {name: "Delete", icon: "delete", callback: $.noop, accesskey:"d e l t"},
            sep1: "---------",
            quit: {name: "Quit", icon: "quit", callback: $.noop, accesskey:"q u i t"}
        }});

        //not working
        $('.context-menu-one').contextMenu('commands[0].disabled','true');
      });

  </script> 

Not working, any Idea?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:54:40+00:00Added an answer on May 26, 2026 at 3:54 am

    According to the plugin’s documentation, you can specify a function to be called in order to determine if a menu item is disabled or not.

    So, you can have that function close over a local variable, and update that variable in order to enable or disable the items. Something like:

    $(function() {
        var itemsDisabled = {};  // Enable everything initially.
        $.contextMenu({
            selector: ".context-menu-one",
            items: {
                // [...]
                cut: {
                    name: "Cut",
                    icon: "cut",
                    callback: $.noop,
                    accesskey: "c u t",
                    disabled: function(key, opt) {
                        return !!itemsDisabled[key];
                    }
                }
                // [...]
            }
        });
    
        // Disable the "Cut" menu item.
        itemsDisabled["cut"] = true;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this ASP.NET MVC application that I now want to separate out the
I have an ASP.NET MVC-application which I want deployable on both IIS6 and IIS7
I have an ASP.NET MVC application, with some RESTful services that I'm trying to
In an ASP.NET MVC application I have a CartController with this AddToCart action: public
I have an ASP.NET MVC application which is pretty simple so far, but I
I have an asp.net mvc 3 application. In this application I have a reminder
I am working on asp.net MVC application. I have a folder with some sub
I have an asp.net mvc application that works fine under visual studio but when
ASP.NET MVC application. I have a Html.DropDownList. I want to redirect to another controller
I have an ASP.Net MVC application and I am using StructureMap within MVC to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.