Question

Remove OOTB copy option on detail grid in Freedom UI

Hi Community,

 

In Creatio Freedom UI, any idea how to remove the OOTB copy option on detail grid? I wanted to retain only open and delete.

{
                "operation": "merge",
                "name": "ProductsList",
                "values": {
                    "features": {
                        "editable": {
                            "enable": true,
                            "itemsCreation": false
                        },
                        "rows": {
                            "selection": {
                                "enable": true,
                                "multiple": true
                            }
                        }
                    },
                    "columns": [
                        {
                            "id": "b2a9f446-9fe2-62dc-5ae7-6d310c8f377c",
                            "code": "ProductsListDS_Product",
                            "caption": "#ResourceString(ProductsListDS_Product)#",
                            "dataValueType": 10,
                            "width": 155.99737548828125
                        },
                        {
                            "id": "fbdc88c3-1804-4bd7-bcf4-d780f3266db7",
                            "code": "ProductsListDS_Quantity",
                            "caption": "#ResourceString(ProductsListDS_Quantity)#",
                            "dataValueType": 32,
                            "width": 122
                        },
                        {
                            "id": "92e6557b-0230-186b-843d-d49d84d1f0d3",
                            "code": "ProductsListDS_Price",
                            "caption": "#ResourceString(ProductsListDS_Price)#",
                            "dataValueType": 32,
                            "width": 114
                        },
                        {
                            "id": "7e24ec9a-fe25-b670-83e8-4b894cc28fb5",
                            "code": "ProductsListDS_Amount",
                            "caption": "#ResourceString(ProductsListDS_Amount)#",
                            "dataValueType": 32,
                            "width": 126
                        },
                        {
                            "id": "9e6cf8c7-3907-e7bb-fc7b-ab577187879c",
                            "code": "ProductsListDS_Comment",
                            "caption": "#ResourceString(ProductsListDS_Comment)#",
                            "dataValueType": 29,
                            "width": 325
                        }
                    ]
                }
            },

Like 0

Like

1 comments

You can see an article on that topic here: https://customerfx.com/article/adding-row-action-menu-items-to-a-creatio-freedom-ui-list/

Basically, you can't just remove the copy only. Instead, you need to replace the entire rowToolbarItems property for the List with a new array of items, adding back in the Open and Delete and exclude the Copy. 

To remove just the copy, you'd add this to the List (in the values part):

{
    "operation": "merge",
    "name": "ProductsList",
    "values": {
        "rowToolbarItems": [
            // default open action
            {
                type: "crt.MenuItem",
                caption: "DataGrid.RowToolbar.Open",
                icon: "edit-row-action",
                disabled: "$ProductsList.PrimaryModelMode | crt.IsEqual : 'create'",
                clicked: {
                    request: "crt.UpdateRecordRequest",
                    params: {
                        "itemsAttributeName": "ProductsList",
                        "recordId": "$ProductsList.ProductsListDS_Id",
                    }
                }
            },
            // default delete action
            {
                type: "crt.MenuItem",
                caption: "DataGrid.RowToolbar.Delete",
                icon: "delete-row-action",
                clicked: {
                    request: "crt.DeleteRecordRequest",
                    params: {
                        "itemsAttributeName": "ProductsList",
                        "recordId": "$ProductsList.ProductsListDS_Id",
                    }
                }
            }
        ]
    }
}

Ryan

Show all comments