How to configure attribute columns for Relationship grid

Prev Next

You can configure the grid columns with product attributes or relationship attributes for Assets, Relationships, and Variants tabs. By default, you can view Type (Entity Type/ Asset Type), ID, and Display Name in the Relationship grids.

Note: The relationship attributes are editable, and you can perform inline editing within the grid for assets, variants and relationships, if it is configured.

Sample JSON configuration for owned relationship

Sample JSON that defines the attribute columns for the Images relationship:

{
  "metaInfo": {
    "dataIndex": "config",
    "collectionName": "configObjects",
    "responseObjectName": "response"
  },
  "configObjects": [
    {
      "id": "rock-entity-relationship-search-result-v2_hasImages_commerceUXConfig",
      "name": "rock-entity-relationship-search-result-v2_hasImages",
      "type": "commerceUXConfig",
      "data": {
        "contexts": [
          {
            "context": {
              "component": "rock-entity-relationship-search-result-v2",
              "relationship": "hasImages"
            },
            "jsonData": {
              "config": {
                "governDataConfig": {
                  "visible": false
                },
                "gridConfig": {
                  "itemConfig": {
                    "fields": {
                      "fileName": {
                        "name": "fileName",
                        "visible": true,
                        "displaySequence": 20,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": true
                      },
                      "isPrimary": {
                        "name": "isPrimary",
                        "visible": true,
                        "displaySequence": 60,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": false
                      },
                      "assetOrder": {
                        "name": "assetOrder",
                        "visible": true,
                        "displaySequence": 10,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": false
                      },
                      "assetLocale": {
                        "name": "assetLocale",
                        "visible": true,
                        "displaySequence": 40,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": true
                      },
                      "imageType": {
                        "name": "imageType",
                        "visible": true,
                        "displaySequence": 30,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": true
                      },
                      "fileExtension": {
                        "name": "fileExtension",
                        "visible": true,
                        "displaySequence": 50,
                        "editType": "",
                        "sortable": true,
                        "isRelatedEntityAttribute": true
                      },
                      "schemaType": "colModel",
                      "viewConfig": {
                        "tile": {
                          "settings": {},
                          "visible": true
                        }
                      },
                      "viewMode": "Tabular"
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  ]
}

Sample JSON configuration for whereused relationship

Sample JSON that defines the attribute columns for the Crosssell Reference relationship:

{
  "metaInfo": {
    "dataIndex": "config",
    "collectionName": "configObjects",
    "responseObjectName": "response"
  },
  "configObjects": [
    {
      "id": "rock-entity-relationship-search-result-v2_crosssellReference_commerceUXConfig",
      "name": "rock-entity-relationship-search-result-v2_crosssellReference",
      "type": "commerceUXConfig",
      "data": {
        "contexts": [
          {
            "context": {
              "component": "rock-entity-relationship-search-result-v2",
              "relationship": "crosssellReference",
              "role": "_DEFAULT",
              "user": "_DEFAULT"
            },
            "jsonData": {
              "config": {
                "governDataConfig": {
                  "visible": false
                },
                "upDirectionConfig": {
                  "gridConfig": {
                    "itemConfig": {
                      "fields": {
                        "typeExternalName": {
                          "visible": true
                        },
                        "id": {
                          "visible": false
                        },
                        "name": {
                          "visible": false
                        },
                        "mdmid": {
                          "name": "mdmid",
                          "visible": true,
                          "displaySequence": 20,
                          "editType": "",
                          "sortable": true,
                          "isRelatedEntityAttribute": true
                        },
                        "mdmname": {
                          "name": "mdmname",
                          "visible": true,
                          "displaySequence": 30,
                          "editType": "",
                          "sortable": true,
                          "isRelatedEntityAttribute": false
                        },
                        "order": {
                          "name": "assetOrder",
                          "visible": true,
                          "displaySequence": 10,
                          "editType": "",
                          "sortable": true,
                          "isRelatedEntityAttribute": false
                        },
                        "schemaType": "colModel",
                        "viewConfig": {
                          "tile": {
                            "settings": {},
                            "visible": true
                          }
                        },
                        "viewMode": "Tabular"
                      }
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  ]
}

To define the columns for owned relationship grid:

  1. Download the attached JSON file.

rock-entity-relationship-search-result-v2_hasImages_commerceUXConfig
3.32 KB
  1. Open the rock-entity-relationship-search-result-v2_hasImages_commerceUXConfig.json file and specify the following:

Parameters

Details

context

component

Specify the name of the component to be configured.

role

Specify the role for which the component is to be configured, else _DEFAULT.

user

Specify the user for which the component is to be configured, else _DEFAULT.

Note: By default, _DEFAULT is specified for role and user parameters, which implies the component is configured for all roles and users.

config

Specify the attributes to be configured in the relationship grid with the following details:

name

Specify the internal name of the attribute.

visible

Show or hide the attribute column in the grid.

  • true – implies the attribute column is displayed in the grid.

  • false – implies the attribute column is hidden in the grid.

displaySequence

Defines the order in which the attribute columns are arranged or displayed in the grid.

sortable

Show or hide sort icons on the column headers.

  • true – implies the attribute column is displayed in the grid.

  • false – implies the attribute column is hidden in the grid.

isRelatedEntityAttribute

Defines the attribute as product attribute or relationship attribute.

  • true – implies the attribute is a product attribute.

  • false – implies the attribute is a relationship attribute.

Note: You must set false for a relationship attribute and true for a product attribute.

  1. Upload the JSON configuration file in the Classic UI. For more information, see How to upload UI Configurations.

    In the PDP, the Assets tab displays the Images relationship grid based on the configured columns.

    ui-configurations-pdp-assets-grid.png