Article
How to quickly generate a page code for the mobile application
16:55 Apr 06, 2018
Question
How to quickly generate a page code for a mobile application.
Can be used for:
- Edit
- Grid
- Preview
Answer
Run the following code in the emulator browser console:
(new Terrasoft.CodeGeneration.PageCodeGenerator({ modelName: "Contact", pageType: Terrasoft.PageTypes.Edit })).generate()
In modelName, specify the desired object.
In pageType, specify the page type:
pageType: Terrasoft.PageTypes.Grid pageType: Terrasoft.PageTypes.Edit pageType: Terrasoft.PageTypes.Preview
The result is:
Terrasoft.LastLoadedPageData = { controllerName: "Terrasoft.configuration.ContactEditPageController", viewXClass: "Terrasoft.configuration.ContactEditPageView" }; Ext.define("Terrasoft.configuration.view.ContactEditPage", { extend: "Terrasoft.view.BaseEditPage", alternateClassName: "Terrasoft.configuration.ContactEditPageView", config: { id: "ContactEditPage" } }); Ext.define("Terrasoft.configuration.controller.ContactEditPage", { extend: "Terrasoft.controller.BaseEditPage", alternateClassName: "Terrasoft.configuration.ContactEditPageController", statics: { Model: Contact }, config: { refs: { view: "#ContactEditPage" } } });