Add header text to the MainContainerWidget of your Genero Web Client for JavaScript
(GWC-JS) project user interface.
-
Open the project_dir/customization/custom_project_dir/js/MyHeaderBarWidget.tpl.html file with a text editor.
-
Replace the existing div element with your changes:
<div>
This is the header text
</div>
-
Open your project_dir/customization/custom_project_dir/MyMainContainerWidget.js file.
The header bar widget is added. Check that the main container class has code that adds the
header bar class as a child of the main container
widget.
"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());
}
};
});
cls.WidgetFactory.register('MainContainer', cls.MyMainContainerWidget);
});
In
the highlighted code in the JavaScript example, you can see:
-
In your project_dir/customization/custom_project_dir/scss/customization.scss file add a reference to the
MyMainContainerWidget.scss. In this example we import the
MyMainContainerWidget style.
@import "MyMainContainerWidget";
-
Rebuild using grunt.