How to remove items from Context Menu

Document ID : KB000054572
Last Modified Date : 14/02/2018
Show Technical Document Details

Description

When I use the right-mouse-click on an Incident number in the Incident list, I get a small menu. How can I remove an item from this menu?

Solution

For an example, you may wish to remove "Escalate" in the list below:

Figure 1

The menu you see is the ContextMenu. As other menus, this can be customized in the sitemods.js file.

  1. copy %NX_ROOT%/sdk/scripts/sitemods.js to %NX_ROOT%/site/mods/www/wwwroot/scripts
  2. open the file for editing
  3. inside you will find the function siteContextMenuitemMod( )
  4. activate the function by removing the comments (//) and add the following code:
        function siteContextMenuitemMod(menuName, itemName)     {       if (window.propFormName=="list_in.htmpl") {          if (menuName=="idDetailsMenu") {          // Hiding the Escalate item from the right-click menu list          if (itemName=="Escalate...") {          return false;          }        }      }    }
  5. reboot the server
  6. clear the browser cache

Now it looks like this. The "Escalate?" is removed:

Figure 2

Other ContextMenuitems can be removed in the same way.

If you want to remove items form other forms, you simply use the relevant modification function in the same way.

For example, to remove an item from the Issue list, then use "list_iss.htmpl", instead of "list_in.htmpl" in the code above.