class sap.ui.core.delegate.ScrollEnablement

Visiblity: protected
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/core/delegate/ScrollEnablement
Application Component: CA-UI5-COR

Delegate for touch scrolling on mobile devices.

This delegate uses native scrolling of mobile and desktop browsers. Third party scrolling libraries are not supported.

Controls that implement ScrollEnablement should additionally provide the getScrollDelegate method that returns the current instance of this delegate object


Constructor

Creates a ScrollEnablement delegate that can be attached to Controls requiring capabilities for scrolling of a certain part of their DOM.

new sap.ui.core.delegate.ScrollEnablement(oControl, sScrollContentDom, oConfig)
Param Type Default Value Description
oControl sap.ui.core.Control

the Control of which this Scroller is the delegate

sScrollContentDom string

the Id of the element within the DOM of the Control which should be scrollable

oConfig object

the configuration of the scroll delegate

horizontal? boolean false

Whether the element should be scrollable horizontally

vertical? boolean false

Whether the element should be scrollable vertically

zynga? boolean false

@deprecated since 1.42, the parameter has no effect

iscroll? boolean false

@deprecated since 1.42, the parameter has no effect

preventDefault? boolean false

@deprecated since 1.42, the parameter has no effect

nonTouchScrolling? boolean false

If true, the delegate will also be active to allow touch like scrolling with the mouse on non-touch platforms.

scrollContainerId? string ""

Native scrolling does not need content wrapper. In this case, ID of the container element should be provided.


Methods Overview

Method Description
destroy

Destroys this Scrolling delegate.

This function must be called by the control which uses this delegate in the exit function.

sap.ui.core.delegate.ScrollEnablement.extend

Creates a new subclass of class sap.ui.core.delegate.ScrollEnablement with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

getChildPosition

Calculates scroll position of a child of a container.

getHorizontal

Get current setting for horizontal scrolling.

sap.ui.core.delegate.ScrollEnablement.getMetadata

Returns a metadata object for class sap.ui.core.delegate.ScrollEnablement.

getVertical

Get current setting for vertical scrolling.

onOverflowChange

Sets the listener for the custom overflowChange event

Only a single listener can be registered

refresh

Refreshes this Scrolling delegate.

scrollTo

Scrolls to a specific position in scroll container.

scrollToElement

Scrolls to an element within a container.

setBounce

Setter for property bounce.

setGrowingList

Sets GrowingList control to scroll container

setHorizontal

Enable or disable horizontal scrolling.

setIconTabBar

Sets IconTabBar control to scroll container

setOnAfterScrollToElement

Sets the listener for the end of any scrollToElement

Only a single listener can be registered

setPullDown

Set overflow control on top of scroll container.

setVertical

Enable or disable vertical scrolling.

destroy

Destroys this Scrolling delegate.

This function must be called by the control which uses this delegate in the exit function.

sap.ui.core.delegate.ScrollEnablement.extend

Creates a new subclass of class sap.ui.core.delegate.ScrollEnablement with name sClassName and enriches it with the information contained in oClassInfo.

oClassInfo might contain the same kind of information as described in sap.ui.base.Object.extend.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

getChildPosition

Calculates scroll position of a child of a container.

Param Type DefaultValue Description
vElement HTMLElement jQuery

An element(DOM or jQuery) for which the scroll position will be calculated.

getHorizontal

Get current setting for horizontal scrolling.

sap.ui.core.delegate.ScrollEnablement.getMetadata

Returns a metadata object for class sap.ui.core.delegate.ScrollEnablement.

getVertical

Get current setting for vertical scrolling.

onOverflowChange

Sets the listener for the custom overflowChange event

Only a single listener can be registered

Param Type DefaultValue Description
fnCallback function

refresh

Refreshes this Scrolling delegate.

scrollTo

Scrolls to a specific position in scroll container.

Param Type DefaultValue Description
iHorizontalPosition int

Horizontal position of the scrollbar

iVerticalPosition int

Vertical position of the scrollbar

iTime int 0

The duration of animated scrolling in milliseconds. To scroll immediately without animation, give 0 as value.

fnCallback function

scrollToElement

Scrolls to an element within a container.

Param Type DefaultValue Description
oElement HTMLElement

A DOM element.

iTime int 0

The duration of animated scrolling in milliseconds. To scroll immediately without animation, give 0 as value.

aOffset int[] [0,0]

Specifies an additional left and top offset of the target scroll position, relative to the upper left corner of the DOM element

setBounce

Setter for property bounce.

Param Type DefaultValue Description
bBounce boolean

new value for property bounce.

setGrowingList

Sets GrowingList control to scroll container

Param Type DefaultValue Description
fnScrollLoadCallback function

Scrolling callback

sScrollLoadDirection sap.m.ListGrowingDirection

Scrolling direction

fnOverflowChange function

listener for the overflowChange event

setHorizontal

Enable or disable horizontal scrolling.

Param Type DefaultValue Description
bHorizontal boolean

set true to enable horizontal scrolling, false - to disable

setIconTabBar

Sets IconTabBar control to scroll container

Param Type DefaultValue Description
oIconTabBar sap.m.IconTabBar

instance

fnScrollEndCallback function

callback function for the scroll end event

fnScrollStartCallback function

callback function for the scroll start event

setOnAfterScrollToElement

Sets the listener for the end of any scrollToElement

Only a single listener can be registered

Param Type DefaultValue Description
fnCallback function

setPullDown

Set overflow control on top of scroll container.

Param Type DefaultValue Description
oControl sap.ui.core.Control

Top control that should be normally hidden over the top border of the scroll container (pull-down content).

setVertical

Enable or disable vertical scrolling.

Param Type DefaultValue Description
bVertical boolean

set true to enable vertical scrolling, false - to disable