Class sap.ui.core.ScrollBarModule: sap/ui/core/ScrollBar

extends Control

The ScrollBar control can be used for virtual scrolling of a certain area. This means: to simulate a very large scrollable area when technically the area is small and the control takes care of displaying the respective part only. E.g. a Table control can take care of only rendering the currently visible rows and use this ScrollBar control to make the user think he actually scrolls through a long list.
Constructor Summary
new sap.ui.core.ScrollBar(sId?, mSettings?)Constructor for a new ScrollBar.
Event Summary
scroll(oControlEvent)Scroll event.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.core.ScrollBar.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.ScrollBar with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.ScrollBar.getMetadata()Returns a metadata object for class sap.ui.core.ScrollBar.
attachScroll(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the scroll event of this sap.ui.core.ScrollBar.
bind(oOwnerDomRef)Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself.
detachScroll(fnFunction, oListener)Detaches event handler fnFunction from the scroll event of this sap.ui.core.ScrollBar.
fireScroll(mParameters?)Fires event scroll to attached listeners.
getContentSize()Gets current value of property contentSize.
getScrollPosition()Gets current value of property scrollPosition.
getSize()Gets current value of property size.
getSteps()Gets current value of property steps.
getVertical()Gets current value of property vertical.
pageDown()Page Down is used to scroll one page forward.
pageUp()Page Up is used to scroll one page back.
setContentSize(sContentSize)Sets a new value for property contentSize.
setScrollPosition(iScrollPosition)Sets a new value for property scrollPosition.
setSize(sSize)Sets a new value for property size.
setSteps(iSteps)Sets a new value for property steps.
setVertical(bVertical)Sets a new value for property vertical.
unbind(oOwnerDomRef)Unbinds the mouse wheel scroll event of the control that has the scrollbar
Constructor Detail
new sap.ui.core.ScrollBar(sId?, mSettings?)

Constructor for a new ScrollBar.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.

The supported settings are:

  • Properties

  • Events

    • scroll : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Event Detail
scroll(oControlEvent)
Scroll event.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
sap.ui.core.ScrollBarActionoControlEvent.getParameters.actionActions are: Click on track, button, drag of thumb, or mouse wheel click.
booleanoControlEvent.getParameters.forwardDirection of scrolling: back (up) or forward (down).
intoControlEvent.getParameters.newScrollPosCurrent Scroll position either in pixels or in steps.
intoControlEvent.getParameters.oldScrollPosOld Scroll position - can be in pixels or in steps.
Method Detail
sap.ui.core.ScrollBar.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.core.ScrollBar 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.core.Control.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.core.ScrollBar.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.ScrollBar.
Returns:
sap.ui.base.MetadataMetadata object describing this class
attachScroll(oData?, fnFunction, oListener?): sap.ui.core.ScrollBar

Attaches event handler fnFunction to the scroll event of this sap.ui.core.ScrollBar.

When called, the context of the event handler (its this) will be bound to oListener if specified, otherwise it will be bound to this sap.ui.core.ScrollBar itself.

Scroll event.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.core.ScrollBar itself
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
bind(oOwnerDomRef)
Binds the mouse wheel scroll event of the control that has the scrollbar to the scrollbar itself.
Parameters:
stringoOwnerDomRefDom ref of the control that uses the scrollbar
detachScroll(fnFunction, oListener): sap.ui.core.ScrollBar

Detaches event handler fnFunction from the scroll event of this sap.ui.core.ScrollBar.

The passed function and listener object must match the ones used for event registration.

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
fireScroll(mParameters?): sap.ui.core.ScrollBar
Fires event scroll to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
sap.ui.core.ScrollBarActionmParameters.action?Actions are: Click on track, button, drag of thumb, or mouse wheel click.
booleanmParameters.forward?Direction of scrolling: back (up) or forward (down).
intmParameters.newScrollPos?Current Scroll position either in pixels or in steps.
intmParameters.oldScrollPos?Old Scroll position - can be in pixels or in steps.
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
getContentSize(): sap.ui.core.CSSSize

Gets current value of property contentSize.

Size of the scrollable content (in pixels).

Returns:
sap.ui.core.CSSSizeValue of property contentSize
getScrollPosition(): int

Gets current value of property scrollPosition.

Scroll position in steps or pixels.

Returns:
intValue of property scrollPosition

Gets current value of property size.

Size of the Scrollbar (in pixels).

Returns:
sap.ui.core.CSSSizeValue of property size
getSteps(): int

Gets current value of property steps.

Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically.

Returns:
intValue of property steps
getVertical(): boolean

Gets current value of property vertical.

Orientation. Defines if the Scrollbar is vertical or horizontal.

Default value is true.

Returns:
booleanValue of property vertical
pageDown()
Page Down is used to scroll one page forward.
pageUp()
Page Up is used to scroll one page back.
setContentSize(sContentSize): sap.ui.core.ScrollBar

Sets a new value for property contentSize.

Size of the scrollable content (in pixels).

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.CSSSizesContentSizeNew value for property contentSize
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
setScrollPosition(iScrollPosition): sap.ui.core.ScrollBar

Sets a new value for property scrollPosition.

Scroll position in steps or pixels.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
intiScrollPositionNew value for property scrollPosition
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
setSize(sSize): sap.ui.core.ScrollBar

Sets a new value for property size.

Size of the Scrollbar (in pixels).

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
sap.ui.core.CSSSizesSizeNew value for property size
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
setSteps(iSteps): sap.ui.core.ScrollBar

Sets a new value for property steps.

Number of steps to scroll. Used if the size of the content is not known as the data is loaded dynamically.

When called with a value of null or undefined, the default value of the property will be restored.

Parameters:
intiStepsNew value for property steps
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
setVertical(bVertical): sap.ui.core.ScrollBar

Sets a new value for property vertical.

Orientation. Defines if the Scrollbar is vertical or horizontal.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is true.

Parameters:
booleanbVerticalNew value for property vertical
Returns:
sap.ui.core.ScrollBarReference to this in order to allow method chaining
unbind(oOwnerDomRef)
Unbinds the mouse wheel scroll event of the control that has the scrollbar
Parameters:
stringoOwnerDomRefDom ref of the Control that uses the scrollbar