Question

Hide Detail-grid menu options

Hello,

How do we remove or disable the following menu items for a grid in detail area?

  • Select multiple records
  • Apply filter
  • Sort by(i.e. disable all sort options)

 

Like 0

Like

1 comments
Best reply

Hi Allen, 

 

In order to remove "Select multiple records", "Apply filter", "Sort by" you can do the following: 

 

1. Create a replacing client module schema for the detail schema. Here is the article on how you can do it:

https://academy.creatio.com/documents/technic-sdk/7-16/creating-custom-…

 

2. In a replaced client schema, please override method addGridOperationsMenuItems as in the example below:

 

define("UsrSchemac2207388Detail", [], function() {
  return {
    entitySchemaName: "UsrPets",
    details: /SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
    diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
    methods: {
      addGridOperationsMenuItems: function(toolsButtonMenu) {
        const switchGridModeMenuItem = this.getSwitchGridModeMenuItem();
        if (!switchGridModeMenuItem) {
          toolsButtonMenu.addItem(this.getButtonMenuSeparator());
          toolsButtonMenu.addItem(switchGridModeMenuItem);
        }
        const exportToExcelMenuItem = this.getExportToExcelFileMenuItem();
        if (exportToExcelMenuItem) {
          toolsButtonMenu.addItem(exportToExcelMenuItem);
        }
        const fileImportMenuItem = this.getDataImportMenuItem();
        if (fileImportMenuItem) {
          toolsButtonMenu.add("FileImportMenuItem", fileImportMenuItem);
        }
        Terrasoft.each([
          this.getGridSettingsMenuItem(),
          this.getRecordChangeLogMenuItem(),
          this.getObjectChangeLogSettingsMenuItem()
        ], function(buttonConfig) {
          if (buttonConfig) {
            toolsButtonMenu.addItem(this.getButtonMenuSeparator());
            toolsButtonMenu.addItem(buttonConfig);
          }
        }, this);
      },
    },
  };
});

If you want to do that in all details you can override BaseGridDetailV2 and override the method in the same way. 

Best regards, 
Anastasiia

Hi Allen, 

 

In order to remove "Select multiple records", "Apply filter", "Sort by" you can do the following: 

 

1. Create a replacing client module schema for the detail schema. Here is the article on how you can do it:

https://academy.creatio.com/documents/technic-sdk/7-16/creating-custom-…

 

2. In a replaced client schema, please override method addGridOperationsMenuItems as in the example below:

 

define("UsrSchemac2207388Detail", [], function() {
  return {
    entitySchemaName: "UsrPets",
    details: /SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
    diff: /**SCHEMA_DIFF*/[]/**SCHEMA_DIFF*/,
    methods: {
      addGridOperationsMenuItems: function(toolsButtonMenu) {
        const switchGridModeMenuItem = this.getSwitchGridModeMenuItem();
        if (!switchGridModeMenuItem) {
          toolsButtonMenu.addItem(this.getButtonMenuSeparator());
          toolsButtonMenu.addItem(switchGridModeMenuItem);
        }
        const exportToExcelMenuItem = this.getExportToExcelFileMenuItem();
        if (exportToExcelMenuItem) {
          toolsButtonMenu.addItem(exportToExcelMenuItem);
        }
        const fileImportMenuItem = this.getDataImportMenuItem();
        if (fileImportMenuItem) {
          toolsButtonMenu.add("FileImportMenuItem", fileImportMenuItem);
        }
        Terrasoft.each([
          this.getGridSettingsMenuItem(),
          this.getRecordChangeLogMenuItem(),
          this.getObjectChangeLogSettingsMenuItem()
        ], function(buttonConfig) {
          if (buttonConfig) {
            toolsButtonMenu.addItem(this.getButtonMenuSeparator());
            toolsButtonMenu.addItem(buttonConfig);
          }
        }, this);
      },
    },
  };
});

If you want to do that in all details you can override BaseGridDetailV2 and override the method in the same way. 

Best regards, 
Anastasiia

Show all comments