Menus

Add a button to a menu

“I want to add an action to the global user menu for all administrators.”

Figure 20. A new action appears in the user menu for administrators

  1. Navigate to Administration > Configuration > Client Presentation in the TOC.
  2. Click the Search button to run the Client Presentation search.
  3. Click the Global item property in the single search result.
  4. In the Command Bar Section grid, open the com.aras.innovator.cui_default.mwh_header_user_menu item with the MainWindowHeader location.
  5. Click the Edit button.
  6. Click the New button in the Command Bar Item grid, then select Menu Button > OK in the dialog to create a new menu button with the following properties:

    1. Name: My_Custom_Admin_Action
    2. Sort Order: 3100
    3. Action: Add
    4. For Identity: Administrators
  7. Right click the new button row and select Open.
  8. Enter the following properties for the new Menu Button:
    1. Label: My Admin Action
    2. Parent Menu: com.aras.innovator.cui_default.mwh_user_menu
    3. Click Method: select a Method you want to run when the button is clicked
  9. Click the Save button and close the Menu Button tab.
  10. Click the Save button in the Command Bar Section tab.
  11. Logout of Aras Innovator and log back in as a member of the Administrators identity.
  12. Click the global user menu button in the top right corner of the window and select My Admin Action to run your custom action.

Disable a menu

“I want to disable the Share menu button for items that are not yet released.”

Figure 21. The default “share” menu is disabled for non-released items

  1. Navigate to Administration > Configuration > Client Presentation in the TOC.
  2. Click the Search button to run the Client Presentation search.
  3. Click the Global item property in the single search result.
  4. In the Command Bar Section grid, open the itemview.itemcommandbar.default item.
  5. In the Command Bar Item grid, open the itemview.itemcommandbar.default.share item.
  6. Click the Edit button.
  1. Replace the Init Method with a custom Method that contains the following code:

if

(!options.eventState) {

options.eventState = aras.evalMethod(‘cui_reinit_calc_tearoff_states’);

}

// get the release state of the context item

var

contextItem = aras.getItemById(options.itemTypeName, options.itemId);

var

isReleased = aras.getItemProperty(contextItem,'is_released’,'0');

// disable the menu when the item is not released

return

{

‘hidden': options.eventState.isNew,

‘disabled': (isReleased === ‘0')

};

  1. Click Save and close the Menu item.
  2. Open any non-released item to confirm that the Share menu button is disabled. The button will be enabled for any released item.

Add a submenu to a menu

“I want to move ‘Structure Browser’ and ‘Where Used’ to a submenu of the main grid context menu.”

Figure 22. The default structure browser and where used actions appear in a new submenu

  1. Navigate to Administration > Configuration > Client Presentation in the TOC.
  2. Click the Search button to run the Client Presentation search.
  3. Click the Global item property in the single search result.
  4. In the Command Bar Section grid, open the com.aras.innovator.cui_default.popup_menu_for_item_grid item.
  5. Click the Edit button.
  6. Click the New button in the Command Bar Item grid, then select Menu > OK in the dialog to create a new menu button with the following properties:
    1. Name: My_Nav_Menu
    2. Init Method: initPopupItemInItemsGrid
    3. Sort Order: 1300
    4. Action: Add
    5. For Identity: World
  7. Right click the new button row and select Open.
  8. Set the following properties:

Label: Navigation

  1. Click Save and close the new Menu tab.
  2. Move the Structure Browser action to the new submenu:
    1. On the Command Bar Section form, open the com.aras.innovator.cui_default.pmig_Structure Browser Menu from the Command Bar Item grid.
    2. Click the Edit button.
    3. Set the Parent Menu property to My_Nav_Menu.
    4. Save and close the Structure Browser Menu item tab.
  3. Move the Where Used action to the new submenu:
    1. On the Command Bar Section form, open the com.aras.innovator.cui_default.pmig_Where Used Menu from the Command Bar Item grid.
    2. Click the Edit button.
    3. Set the Parent Menu property to My_Nav_Menu.
    4. Save and close the Where Used Menu item tab.
  4. Click the Save button for the Command Bar Section.
  5. Open any search grid from the TOC and right click on a row to see the new “Navigation” submenu.

Display an icon on a menu button

“I want to show an icon next to the ‘Delete’ action in the main grid context menu.”

Figure 23. An icon appears next to the delete action in the main grid menu

  1. Navigate to Administration > Configuration > Client Presentation in the TOC.
  2. Click the Search button to run the Client Presentation search.
  3. Click the Global item property in the single search result.
  4. In the Command Bar Section grid, open the com.aras.innovator.cui_default.popup_menu_for_item_grid item.
  5. Click the Edit button.
  6. In the Command Bar Item grid, open the com.aras.innovator.cui_default.pmig_Delete item.
  7. Click the Edit button.
  8. Use the Image property to choose the icon you want to show in the menu.
  9. Click Save and close the Menu item.
  10. Click Save and close the Command Bar Section item.
  11. Open any search grid from the TOC and right click on a row to see your selected icon appear next to the “Delete All Versions” action.