Class sap.ui.core.delegate.ScrollEnablementModule: sap/ui/core/delegate/ScrollEnablement
Delegate for touch scrolling on mobile devices
This delegate uses CSS (-webkit-overflow-scrolling) only if supported. Otherwise the desired scrolling library is used. Please also consider the documentation of the library for a proper usage.
Controls that implement ScrollEnablement should additionally provide the getScrollDelegate method that returns the current instance of this delegate object
Experimental API:Since 1.5.2. This class is experimental and provides only limited functionality. Also the API might be changed in future.
Constructor Summary
new sap.ui.core.delegate.ScrollEnablement(oControl, sScrollContentDom, oConfig)Creates a ScrollEnablement delegate that can be attached to Controls requiring capabilities for scrolling of a certain part of their DOM on mobile devices.
Method Summary
sap.ui.core.delegate.ScrollEnablement.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.delegate.ScrollEnablement with name
sClassName
and enriches it with the information contained in oClassInfo
.sap.ui.core.delegate.ScrollEnablement.getMetadata()Returns a metadata object for class sap.ui.core.delegate.ScrollEnablement.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.delegate.ScrollEnablement(oControl, sScrollContentDom, oConfig)
Creates a ScrollEnablement delegate that can be attached to Controls requiring capabilities for scrolling of a certain part of their DOM on mobile devices.
Parameters:
{sap.ui.core.Control} | oControl | the Control of which this Scroller is the delegate |
{string} | sScrollContentDom | the Id of the element within the DOM of the Control which should be scrollable |
{object} | oConfig | the configuration of the scroll delegate |
{boolean} | oConfig.horizontal? | Whether the element should be scrollable horizontally |
{boolean} | oConfig.vertical? | Whether the element should be scrollable vertically |
{boolean} | oConfig.zynga? | If set, then the Zynga scroller (http://zynga.github.com/scroller/) is used |
{boolean} | oConfig.iscroll? | If set, then iScroll (http://cubiq.org/iscroll-4) is used |
{boolean} | oConfig.preventDefault? | If set, the default of touchmove is prevented |
{boolean} | oConfig.nonTouchScrolling? | If true, the delegate will also be active to allow touch like scrolling with the mouse on non-touch platforms. |
{string} | oConfig.scrollContainerId?, Default: "" | Native scrolling does not need content wrapper. In this case, ID of the container element should be provided. |
Method Detail
sap.ui.core.delegate.ScrollEnablement.extend(sClassName, oClassInfo?, FNMetaImpl?): function
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.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
sap.ui.core.delegate.ScrollEnablement.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.delegate.ScrollEnablement.
Returns:
{sap.ui.base.Metadata} | Metadata object describing this class |
destroy()
Destroys this Scrolling delegate.
This function must be called by the control which uses this delegate in the exit
function.
getChildPosition(vElement): object
Calculates scroll position of a child of a container.
Parameters:
{HTMLElement|jQuery} | vElement | An element(DOM or jQuery) for which the scroll position will be calculated. |
Returns:
{object} | Position object. |
getHorizontal(): boolean
Get current setting for horizontal scrolling.
- Since:
- 1.9.1
Returns:
{boolean} | true if horizontal scrolling is enabled |
getVertical(): boolean
Get current setting for vertical scrolling.
- Since:
- 1.9.1
Returns:
{boolean} | true if vertical scrolling is enabled |
scrollToElement(oElement, iTime?): ScrollEnablement
Scrolls to an element within a container.
Parameters:
{HTMLElement} | oElement | A DOM element. |
{int} | iTime? | The duration of animated scrolling in milliseconds. To scroll immediately without animation, give 0 as value. |
Returns:
{ScrollEnablement} |
setBounce(bBounce)
Setter for property
bounce
. Parameters:
{boolean} | bBounce | new value for property bounce . |
- Since:
- 1.17
setGrowingList(GrowingList)
Sets GrowingList control to scroll container
Parameters:
{sap.m.GrowingList} | GrowingList | instance This function is supported in iScroll and mouse delegates only. |
- Since:
- 1.11.0
setHorizontal(bHorizontal)
Enable or disable horizontal scrolling.
Parameters:
{boolean} | bHorizontal | set true to enable horizontal scrolling, false - to disable |
setIconTabBar(IconTabBar)
Sets IconTabBar control to scroll container
Parameters:
{sap.m.IconTabBar} | IconTabBar | instance This function is supported in iScroll only. |
- Since:
- 1.16.1
setPullDown(top)
Set overflow control on top of scroll container.
Parameters:
{sap.ui.core.Control} | top | control that should be normally hidden over the top border of the scroll container (pull-down content). This function is supported in iScroll delegates only. In MouseScroll delegates the element is not hidden and should have an appropriate rendering for being always displayed and should have an alternative way for triggering (e.g. a Button). |
- Since:
- 1.9.2