Question

Remove add action from mobile

Hi Team, 

There is any way to remove this button on the mobile? I tried with this code but didn't work.

Terrasoft.sdk.Actions.remove("Account", "add");

Like 0

Like

3 comments

Hello,

Action "add" not like the others, and Terrasoft.sdk.Actions.remove will not work with it.

In order to hide it you need to override a controller and make the method getAddAction return null.

The full code:

1) Add a new module, for example UsrTestRemoveAddModuleConfig:

 Terrasoft.LastLoadedPageData = {
    controllerName: "AccountPreviewPage.Controller",
    viewXClass: "AccountPreviewPage.View"
}; 
Ext.define("AccountPreviewPage.View", {
    extend: "Terrasoft.view.BasePreviewPage",
    config: {
        id: "AccountPreviewPage"
    }
});
Ext.define("AccountPreviewPage.Controller", {
    extend: "Terrasoft.controller.BasePreviewPage",
    statics: {
        Model: Account
    },
    config: {
        refs: {
            view: "#AccountPreviewPage"
        }
    },
    getAddAction: function () {
        return null;
    }
});

2) Connect it to the PreviewPage in the manifest:

"Models": {
			"Account": {
				"Preview": "UsrTestRemoveAddModuleConfig",

 

Hi Dmytro Vovchenko,

Is it possible to override the Add Record button on the section page of the Mobile Application?



Regards,

Ramya

Ramya R,

 

Let's discuss this in the community thread you created: https://community.creatio.com/questions/override-add-button-click-grid-…

 

Show all comments