Question

How Hide or Remove Actions from a Section

Hello to everyone!

I'm trying to Hide or Remove Actions from a Section.

i.e: Data Import or Export to Excel

any ideas?

Thanks in advance for your support

Regards,

Fernando

Like

11 comments

Hello Fernando,

The default actions collection is populated in the getSectionActions method of the BaseSectionV2 schema (https://prnt.sc/ko83fb). 
In order to remove or hide any of the default actions from the section, you need to create a replacing schema and override the getSectionActions method.
In order to hide the specific action, you will need to change a Visible property:

getSectionActions: function() {
                var actionMenuItems = this.callParent(arguments);
                actionMenuItems.each(function(item) {
                    if(item.values.Caption.bindTo === "Resources.Strings.ExportListToExcelFileButtonCaption"){
                        item.values.Visible = false;
                    }
                });
                return actionMenuItems;
            }
In order to remove the specific action from the collection:

getSectionActions: function() {
                var actionMenuItems = this.callParent(arguments);
                var itemToRemove;
                actionMenuItems.each(function(item) {
                    if(item.values.Caption.bindTo === "Resources.Strings.ExportListToExcelFileButtonCaption"){
                        itemToRemove = item;
                    }
                });
                actionMenuItems.remove(itemToRemove);
                return actionMenuItems;
            }
 

Thanks Tetiana!

 

Where we configure the filters.

Example: I don't want to see the Owner filter in Lead Sections

also ...what happens if I need to hide or remove any of these objects?

Hello Fernando,

You can configure your own filters as well as override existing ones in the initFixedFiltersConfig method. Please, see the documentation - https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-quick-f…

Could you, please specify your second question, please?

Hi Tetiana, i'm trying to hide or remove this Object (Filter) from Lead Section

 

Fernando,

You need to override the initFixedFiltersConfig method in your LeadSectionV2 replacing client schema.
    initFixedFiltersConfig: function() {
                        var fixedFilterConfig = {
                            entitySchema: this.entitySchema,
                            filters: []
                        };
                        this.set("FixedFilterConfig", fixedFilterConfig);
                    }
In such case, there will be no filters in the Lead Section. You can also configure your own filters in the 'filters' array.
Please, see the documentation - https://academy.bpmonline.com/documents/technic-sdk/7-12/adding-quick-f…

Thanks Tetiana!

I want to remove the "Data import" in the Action menu but couldn't find any related string under "LocalizableStrings" in BaseSectionV2. Please help.

 

JP Ngo,

Please take a look at getDataImportMenuItem method of BaseDataView schema. It creates data import menu item for section actions.

			getDataImportMenuItem: function() {
				if (this.getIsImportEnabled()) {
					const config = this.getFileImportMenuItemCfg();
					return this.getButtonMenuItem(config);
				}
			},

This method is executed from getSectionActions method. 

Regards,

Anastasia

Log in or register to comment