This widget provides a simple way in which you can keep a "header" and/or "footer" always visible whilst any overflowing main content is scrolled. The header, footer and [main content]{@link module:alfresco/layout/FixedHeaderFooter#widgetsForFooter} should be defined as standard widget models.
The overall height of the widget can be explicitly set but can also be left (or set) to the default value of "auto" which will make the widget take up all the available space in the client window below it.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Example
{
name: "alfresco/layout/FixedHeaderFooter",
config: {
height: "auto",
widgetsForHeader: [
{
name: "alfresco/menus/AlfMenuBar",
config: {
widgets: [
{
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: "Menu item in header"
}
}
]
}
}
],
widgets: [
{
name: "alfresco/lists/AlfList",
config: {
currentData: {
items: [
{ name: "one" }, { name: "two" }, { name: "three" }
]
},
widgets: [
{
name: "alfresco/lists/views/HtmlListView",
config: {
propertyToRender: "name"
}
}
]
}
}
],
widgetsForFooter: [
{
name: "alfresco/menus/AlfMenuBar",
config: {
popupMenusAbove: true,
widgets: [
{
name: "alfresco/menus/AlfMenuBarItem",
config: {
label: "Menu item in footer"
}
}
]
}
}
]
}
}
Members
-
autoHeightPaddingAllowance :number
-
If this widget is placed into a widget that has padding then this allowance can be configured which will be substituted from the calculated height to take padding into account so that an outer scroll bar is not required on the page. This defaults to 0 and has only been provided for potential convenience. This value will only be used on when height is set to "auto" (which is also the default).
Type:
- number
- Deprecated:
- Since 1.0.36 use heightAdjustment instead
- Default Value:
- 0
- Source:
-
baseClass :string
-
The base class for the widget
Type:
- string
- Default Value:
- "alfresco-layout-FixedHeaderFooter"
- Source:
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/FixedHeaderFooter.css"}]
- Source:
-
height :string
-
The height of the widget (in CSS units). The default value is "auto" which means that the height of the widget will automatically be set to take up the available space from its current position to the bottom of the window or document (whichever is smallest) so that the entire widget is visible on page load. If a percentage height is set it is imperative that the enclosing DOM element has a fixed height (e.g. a value in pixels) otherwise the height will be calculated as 0.
Type:
- string
- Deprecated:
- Since 1.0.36 use heightMode instead
- Default Value:
- "AUTO"
- Source:
-
recalculateAutoHeightOnResize :boolean
-
If this is configured to be true the height of the widget will be reset as the browser window is resized. This will only occur when height is set to "auto" (which is also the default).
Type:
- boolean
- Default Value:
- true
- Source:
-
templateString :String
-
The HTML template to use for the widget.
Type:
- String
- Source:
Methods
-
_doProcessWidgets(widgetInfos)
-
Call the processWidgets function for all provided widgets
Parameters:
Name Type Description widgetInfos
object[] The widget information as objects with 'widgets' and 'node' properties - Source:
-
addHeaderResizeListener()
-
Setup a listener that will call alfPublishResizeEvent whenever a resize is detected in the header.
NOTE: This method is no longer called by the postCreate method, and will be removed in a future version
- Since:
- 1.0.41
- Deprecated:
- Since 1.0.42 - use ResizeMixin.addResizeListener instead.
- Source:
-
allWidgetsProcessed(widgets)
-
Extends the inherited function to set up subscriptions for the visibilityRuleTopics that are returned by calling getVisibilityRuleTopics. The subscriptions need to be created after the widgets have been created in order that their visibility is adjusted before the onResize function that is bound to is called.
Parameters:
Name Type Description widgets
object[] The widgets that have been created - Since:
- 1.0.38
- Source:
-
onResize()
-
Resize the header/content/footer containers so that the content fits between the header and footer.
- Source:
-
postCreate()
-
Run after widget has been created
- Source: