UNPKG

ui5_easy_use

Version:

CLI tool for SAP ui5 and SAPUI5 projects to initialize apps, generate pages, insert form and table components, manage routing, and automate i18n bindings

30 lines (26 loc) 1.21 kB
sap.ui.define([ "sap/ui/core/UIComponent", "sap/ui/model/json/JSONModel", "sap/f/library", "sap/f/FlexibleColumnLayoutSemanticHelper" ], function (UIComponent, JSONModel, library, FlexibleColumnLayoutSemanticHelper) { "use strict"; return UIComponent.extend("${ez5.appName}.Component", { init() { this.LayoutType = library.LayoutType; this.setModel(new JSONModel({}), "fclModel"); }, // Flexible layout page controllers use this helper to calculate the next column state. getHelper: function () { const flexibleColumnLayout = this.getRootControl().byId("app"); const routeParameters = new URLSearchParams(window.location.search); const settings = { defaultTwoColumnLayoutType: this.LayoutType.TwoColumnsBeginExpanded, defaultThreeColumnLayoutType: this.LayoutType.ThreeColumnsEndExpanded, initialColumnsCount: routeParameters.get("initial"), maxColumnsCount: routeParameters.get("max") }; return FlexibleColumnLayoutSemanticHelper.getInstanceFor(flexibleColumnLayout, settings); } }); });