How Do I … ? / Add header and footer text |
Add footer text to the MainContainerWidget of your Genero Web Client for JavaScript (GWC-JS) project user interface.
// declare the dependency to inheritedWidget (here WidgetBase) module modulum('MyFooterBarWidget', ['WidgetBase', 'WidgetFactory'], function(context, cls) { cls.MyFooterBarWidget = context.oo.Class(cls.WidgetBase, function($super) { return { __name: "MyFooterBarWidget" /* your custom code */ }; });
<div> This is the Footer text </div>
"use strict"; modulum('MyMainContainerWidget', ['WidgetGroupBase', 'WidgetFactory'], […] constructor: function() { $super.constructor.call(this); var headerBar = new cls.MyHeaderBarWidget(); headerBar.setParentWidget(this); this.getElement().querySelector("header").appendChild(headerBar.getElement()); var footerBar = new cls.MyFooterBarWidget(); footerBar.setParentWidget(this); this.getElement().querySelector("footer").appendChild(footerBar.getElement()); } }; }); cls.WidgetFactory.register('MainContainer', cls.MyMainContainerWidget); });In the highlighted code in the JavaScript example, you can see:
@import "MyMainContainerWidget";
View the changes by opening the GAS demos application in your browser. You can do this by configuring the demos application for your project, see Test customization using the demo.
The GWC-JS footer text is now changed.