Override Add button click - Grid Page - Mobile App

Hi everyone,

I am looking to override the functionality of the Add Record button on the Grid Page (Section Page) of the Mobile Application. Can you help me figure out the name of the method that gets called when the Add button is tapped?

Thanks & regards,

Ramya

Like 0

Like

4 comments

Hi Ramya,

 

In order to override the functionality of the Add Record button on the Grid Page of the Mobile Application follow these steps:



1) In Configuration create a Module, for example call it UsrChangeButtonLogic:

Ext.define("InvoiceGridPage.Controller", {
    override: "Terrasoft.controller.BaseGridPage",
    statics: {
        Model: Invoice
    },
    executeAddAction: function () {
        console.log('Hello1');
        this.callParent(arguments);
           console.log('Hello2');
    }
});

2) Create a replacing view module for the MobileApplicationManifestDefaultWorkplace module. Or use a mobile wizard  - it will create the manifest automatically. Add the newly created module UsrChangeButtonLogic to the manifest:

  "Models": {
        ...
        },
        "Invoice": {
            ...
            ],
            "ModelExtensions": [],
            "PagesExtensions": [
                "MobileInvoiceRecordPageSettingsDefaultWorkplace",
                "UsrChangeButtonLogic"
            ]
        }
    },

3) Compile your Workplace and synchronize the mobile application again.

 

As a result, "Add record" button click of Invoices Grid Page will be overwritten.  

 

Artem Smyrnov,

Thank you! That worked. Can you also help me figure out how to show a confirmation dialog on the mobile application? Something similar to the web app implementation of Terrasoft.showConfirmation? Thanks in advance!



Regards,

Ramya

Ramya R,



Use Terrasoft.MessageBox.showMessage ('your confirmation dialog message') to display a confirmation dialog.



Many thanks.

Artem

 

Artem Smyrnov,

The Terrasoft.MessageBox.showMessage method only helps in displaying a message to the user. I am looking for a functionality where the user is able to select "Yes" or "No" options below the message. Can you please help me with this?

Thanks,

Ramya

Show all comments