Class Osp.Ui.Controls.ScrollPanel

Since:
1.0

The ScrollPanel class is a Panel with automatic scroll bars.

For more information on the class features, see Panel and ScrollPanel.

Inheritance Diagram
Constructor Summary
Constructor Attributes Constructor Name and Description
 
Creates an instance of the Osp.Ui.Controls.ScrollPanel class.
Method Summary
Method Attributes Method Name and Description
 
Gets the bounds of the client area.
 
{Number} getScrollPosition()
Gets the vertical scroll position.
 
{void} scrollToBottom()
Scrolls down to the bottom of the ScrollPanel control.
 
{void} scrollToTop()
Scrolls up to the top of the ScrollPanel control.
 
{void} setScrollPosition(position)
Sets the vertical scroll position.
Event Summary
Event Attributes Event Name and Description
 
Fired when the scroll reaches to the top or bottom.
Constructor Detail
Osp.Ui.Controls.ScrollPanel(config)
Creates an instance of the Osp.Ui.Controls.ScrollPanel class.
Since:
1.0
Parameters:
{Map} config
: The configuration with keys {bounds:{Map}, layout:{Osp.Ui.Layout}, portraitLayout:{Osp.Ui.Layout}, landscapeLayout:{Osp.Ui.Layout}}

The following key values are updated:
  • Deprecated portraitLayout, landscapeLayout
  • bounds {Map} {x:{Number},y:{Number},width:{Number},height:{Number}} The location and size configuration of the ScrollPanel control
  • layout {Osp.Ui.Layout} The common layout associated with the ScrollPanel control in both orientation modes
  • portraitLayout {Osp.Ui.Layout} The layout associated with the ScrollPanel in the portrait orientation mode
    This will override the layout key if both are provided.
  • landscapeLayout {Osp.Ui.Layout} The layout associated with the ScrollPanel control in the landscape orientation mode
    This will override the layout key if both are provided.
Example:
// Example 1:
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:12, y:80, width:150, height:40}});
formObj.addControl(scrollPanelObj);
// Example 2:
var scrollPanelObj_grid = new Osp.Ui.Controls.ScrollPanel({bounds:{x:12, y:80, width:150, height:40},layout : gridLayout});
formObj.addControl(scrollPanelObj_grid);
Method Detail
{Map} getClientAreaBounds()
Gets the bounds of the client area.
Since:
1.0
Returns:
{Map}
: The bounds of the client area {x:{Number}, y:{Number}, width:{Number}, height:{Number}}.
Example:
 
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:20,y:20,width:100,height:100}})
formObj.addControl(scrollPanelObj);
var map = scrollPanelObj.getClientAreaBounds();

{Number} getScrollPosition()
Gets the vertical scroll position.
Since:
1.0
Returns:
{Number}
: The vertical scroll position
Example:
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:20,y:20,width:100,height:100}});
formObj.addControl(scrollPanelObj);
var position = scrollPanelObj.getScrollPosition();

{void} scrollToBottom()
Scrolls down to the bottom of the ScrollPanel control.
Since:
1.0
Returns:
{void}
Example:
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:20,y:20,width:100,height:100}})
formObj.addControl(scrollPanelObj);
scrollPanelObj.scrollToBottom();

{void} scrollToTop()
Scrolls up to the top of the ScrollPanel control.
Since:
1.0
Returns:
{void}
Example:
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:20,y:20,width:100,height:100}})
formObj.addControl(scrollPanelObj);
scrollPanelObj.scrollToTop();

{void} setScrollPosition(position)
Sets the vertical scroll position.
Since:
1.0
Returns:
{void}
Parameters:
{Number} position
: The vertical scroll position
Example:
var scrollPanelObj = new Osp.Ui.Controls.ScrollPanel({bounds:{x:20,y:20,width:100,height:100}})
formObj.addControl(scrollPanelObj);
scrollPanelObj.setScrollPosition(50);
Event Detail
scrollEnd
Fired when the scroll reaches to the top or bottom. Details of the event object are given below:
KeyValue
sourceThe original ScrollPanel control
typeThe type of scrollEnd event Osp.Ui.Controls.ScrollEndEvent
Since:
1.0