Set up a custom action menu for list and list records

PDF
Easy

You can set up a custom action menu for the list and list records in Creatio version 8.0.4 Atlas and later.

Creatio lets you use action menu that contains default actions for the list and list records or set up a custom action menu.

By default, the action menu for the list contains the following actions:

  • Save list settings for all users
  • Reset to default list settings

By default, the action menu for list records contains the following actions:

  • Open
  • Copy
  • Delete

Set up a custom action menu 

To set up a custom action menu for the list and list records:

  1. Open the Freedom UI page schema that contains the list.
  2. Go to the viewConfigDiff schema section and find the configuration object whose the type property value is "crt.DataGrid". The DataGrid component implements the List type component in the front-end.
  3. Implement a custom action menu.

    • Add the headerToolbarItems array of properties to implement a custom action menu for the list.
    • Add the rowToolbarItems array of properties to implement a custom action menu for list records.

    Attention. Add a configuration object to the property array for each action menu item.

    To add an item to the action menu, use the following properties:

    • type. The registered name of the component to display in the action menu item. Use the "crt.MenuItem" value.
    • caption. The text to display in the action menu item. Can be a constant or "#ResourceString(SomeLocalizableString)#" macro. SomeLocalizableString is the localizable string name in the schema of the Freedom UI page.
    • icon. The name of the icon to display in the action menu item, for example, "edit-row-action". We recommend using the icon property values of the icon button. Learn more in a separate article: Button component.
    • clicked. The action to execute on item click. Learn more about the clicked property in a separate article: Open a page from a custom handler. Set the useRelativeContext property to true for the rowToolbarItems array. Do not use the useRelativeContext property for the headerToolbarItems array. The useRelativeContext property specifies the ViewModel of a page or list record to use in the query processing.

    View the example of the rowToolbarItems array of properties below. This example implements a custom action menu for list records.

    Example of the rowToolbarItems array of properties
    viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
        {
            "operation": "merge",
            "name": "DataTable",
            "values": {
                ...,
                "rowToolbarItems": [{
                    "type": 'crt.MenuItem',
                    "caption": 'DataGrid.RowToolbar.Open',
                    "icon": 'edit-row-action',
                    "clicked": {
                        "request": 'crt.UpdateRecordRequest',
                        "params": {
                            "itemsAttributeName": "Items",
                            "recordId": "$Items.PDS_Id",
                        },
                        "useRelativeContext": true
                    }
                }]
            }
            ...
        },
        ...
    ]/**SCHEMA_VIEW_CONFIG_DIFF*/
    

    As a result, the custom action menu for list records will contain only the Open item.

  4. Click Save on the Client Module Designer's toolbar.