Skip to main content


         This documentation site is for previous versions. Visit our new documentation site for current releases.      
 

This content has been archived and is no longer being updated.

Links may not function; however, this content may be relevant to outdated versions of the product.

How to create context menus for grid layouts using navigation rules

Updated on May 3, 2020

Summary

Context menus enable access to specific actions through a right-click fly-out menu. You can add context menus to grid, tree, and tree grid layouts by building a navigation rule.

In the example below, a navigation rule is used in conjunction with a Grid layout to enable the following options on items within the grid:

  • Add a row
  • Delete a row
  • Add a note

 

Suggested Approach

The Grid layout , introduced in V6.1, allows users to interact with an array (which may represent a Page List or Page Group property). See How to add a Grid layout to a section for basic information about Grid layouts.

To add a context menu to a grid Layout:

  1. On the Advanced tab of a Repeat Grid properties panel, enter the name of a navigation rule to be created in the Right Click field. By default, the navigation rule is created in the page class of the repeat grid.
    Properties Panel
     
  2. In the navigation rule, double-click the first entry to edit the node. On the Node Details panel, set the Type value to Selected Item. This ensures that the configured action will only occur within the context of a single item. Set the Action value to Add Row.

     
  3. Add a new node to the list and repeat step 2. Select the Delete Row action.
     
  4. To add a custom action, you can specify a local action that will appear in a modal window. Add a new node and configure it as shown:


    The specified local action AddNote contains a field to that allows the user to add a note to an item in a Page List, and was created in the same class as the navigation rule.
     
  5. The Editor tab of the completed navigation rule appears as follows:


     
  6. Save the navigation rule and the section or flow action rule that contains the Grid layout. Run the process that calls the flow action. Test the right-click functionality by right-clicking on a row in the grid.
  7. Context menus can have multi-level structures. To build a multi-level context menu, edit the navigation rule to define parent/child nodes.

     
  8. At runtime, when the flow action run, the context menu displays as shown.

Have a question? Get answers now.

Visit the Support Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega.com is not optimized for Internet Explorer. For the optimal experience, please use:

Close Deprecation Notice
Contact us