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
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.
Ramya R,
Use Terrasoft.MessageBox.showMessage ('your confirmation dialog message') to display a confirmation dialog.
Many thanks.
Artem