Question

Removing "delete" option from a Expanded List

Hey everyone! 

How am I able to remove this option from a Expanded list?

Thanks in advance!

Like 1

Like

9 comments
Best reply

You can remove that by overriding the list's rowToolbarItems and just leave it as an empty list. 

 

See this article here: https://customerfx.com/article/adding-row-action-menu-items-to-a-creati…

 

You can override the menu (usually to add other menu items to it). When you do so you override the "Open", "Copy", "Delete" options and need to add them back in. You could override the menu and then just not add back in the delete option. It would look like this (the article will provide more details)

viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
    {
        "operation": "merge",
        "name": "DataTable",
        "values": {
            //...,
            "rowToolbarItems": []
        }
        //...
    },
    //...
]/**SCHEMA_VIEW_CONFIG_DIFF*/

The important part there is just the empty array [] for the rowToolbarItems property. This would leave it with an empty menu (and the delete would no longer show)

Ryan

You can remove that by overriding the list's rowToolbarItems and just leave it as an empty list. 

 

See this article here: https://customerfx.com/article/adding-row-action-menu-items-to-a-creati…

 

You can override the menu (usually to add other menu items to it). When you do so you override the "Open", "Copy", "Delete" options and need to add them back in. You could override the menu and then just not add back in the delete option. It would look like this (the article will provide more details)

viewConfigDiff: /**SCHEMA_VIEW_CONFIG_DIFF*/[
    {
        "operation": "merge",
        "name": "DataTable",
        "values": {
            //...,
            "rowToolbarItems": []
        }
        //...
    },
    //...
]/**SCHEMA_VIEW_CONFIG_DIFF*/

The important part there is just the empty array [] for the rowToolbarItems property. This would leave it with an empty menu (and the delete would no longer show)

Ryan

Hey, Ryan ! 

Many thanks, man! 

The thing I've found out is: 

On this new update, the 8.1.1.3635, there's no "rowToolbarItems": []".  so I had to "create" it. 

Awesome knowing about you, tho. I'll seek out your articles on my next doubt. 

Have an awesome week!

Gabriel Henrique Pagotto Otero,

This is true, you won't always see all properties for a List (or any component), especially in the case where the page inherits the list from the base/parent page. However, any of the properties can be added to the merge to override them from how they are implemented in the base page.

Ryan

Ryan Farley,



It would be time to organize advanced Creatio development training from other Creatio partners, it seems you have most advanced documentation/knowledge😅😅

Gabriel Henrique Pagotto Otero,

 

Hi, I didn't found the schema page where I must add this code? in wich schema I must add it? in the schema page where the detail is? in this case, where?

 

Thanks,

Julio

Julio.Falcon_Nodos,

Yes. You'd add this in the page that contains the list object. That's a main difference from classic where the list was a separate schema, now it's just another element on the page. 

  1. Open the page containing the list
  2. Select the list, on the properties pane, on the very bottom, copy the Code for the list
  3. Toggle to the code for that same page
  4. CTRL+F to locate the code for the list element in name property (it will also have a type of crt.DataGrid)
  5. In the values node of that list element, add the rowToolbarItems: []

Ryan

Found and solved! :-). To help someone with the same issue.

 

1.- You need to get the name of the element where the Grid Detail is 

2.- Edit the code of the page where the Detail/Expanded list, search the element code name you get in the previous step, in my case "GridDetail_PartidasObra" 

3.- Add in the values, the rowToolbarItems, like in the image above  (the code is also shared):

 

// OPTION 1 - If you want to maintain Edit option, remove Copy & Delete
"rowToolbarItems": [{
	type: 'crt.MenuItem',
	caption: 'DataGrid.RowToolbar.Open',
	icon: 'edit-row-action',
	disabled: "$Items.PrimaryModelMode | crt.IsEqual : 'create'",
	clicked: {
		request: 'crt.UpdateRecordRequest',
		params: {
			"itemsAttributeName": "Items",
			"recordId": "$Items.PDS_Id"
		}
	}
}], 
 
 
// OPTION 2 - If you want to remove allm just add
"rowToolbarItems": [],

Ryan Farley,

Thanks Ryan, we are answering it at same time :-)

 

Regards

Julio.Falcon_Nodos,

Be aware, for adding items back in the rowToolbarItems, you'll need to make sure the values for the list's Items and primaryColumnValue match in the added items. For Section lists, these are usually "Items" and "PDS_Id", however for list's added to a page (which I am assuming yours is based on your grid element's name), they are typically different. You'll need to get those values to update in the inserted text. Refer back to here for more: https://customerfx.com/article/adding-row-action-menu-items-to-a-creatio-freedom-ui-list/

Ryan

Show all comments