Module: alfresco/layout/InfiniteScrollArea

alfresco/layout/InfiniteScrollArea

This layout widget can be wrapped around any paginated list configured to use infinite scrolling should be used instead.
Author:
  • Dave Draper
License:
Source:

Example

List inside a FixedHeaderFooter widget

{
  name: "alfresco/layout/FixedHeaderFooter",
  config: {
    height: "200px",
    widgets: [
      {
        name: "alfresco/layout/InfiniteScrollArea",
        config: {
          widgets: [
            {
              name: "alfresco/lists/AlfSortablePaginatedList"
              config: {
                useInfiniteScroll: true,
                widgets: [
                  // Declare view here
                ]
              }
            }
          ]
        }
      }
    ]
  }
}

Members

_registerScrollListenerImmediately :boolean

This overrides the inherited default to ensure that the publishScrollEvents function is NOT called automatically in the constructor.
Type:
  • boolean
Default Value:
  • false
Source:

baseClass :string

The CSS class (or a space separated list of classes) to include in the DOM node.
Type:
  • string
Default Value:
  • "alfresco-layout-InfiniteScrollArea"
Source:

fillAvailableHeight :boolean

The primary purpose of this widget is to support infinite scrolling of lists within a fixed height area. Loadingmore data requires that either a scroll bar is present or the area is resized. However there may be circumstances where the area is too tall, and the initial page size to small for list data to fill. If this attribute is configured to be true then the height of the parent element will be compared against the height of this widget each time list data is loaded, and if the height of this widget is not as big as that of its parent element then a request for more data will be made.

However, in order for this to work it is important that both the list and this widget share the same pubSubScope, the same requestFinishedTopic topic and the same [scrollNearBottom]module:alfresco/documentlibrary/_AlfDocumentListTopicMixin#scrollNearBottom topic. Each time the requestFinishedTopic is published the [onDataLoaded]{@link module:alfresco/layout/InfiniteScrollArea#onDataLoaded} function will be called to compare heights and request more data by publishing the [scrollNearBottom]{@link module:alfresco/documentlibrary/_AlfDocumentListTopicMixin#scrollNearBottom} topic if necessary

Type:
  • boolean
Default Value:
  • true
Source:

Methods

constructor()

The constructor
Source:

onDataLoaded()

This function is called when data is successfully loaded by a list contained within this widget and it compares the height of the widget with that of its parent to determine whether or not to make a request for more data.
Source:

onEventsResize(payload)

Handle resize events on the parent node
Parameters:
Name Type Description
payload Object The payload from the resize
Source:

postCreate()

Extends the inherited function to set the mixed in element to detect scroll position on
Source:
Listens to Events: