You are here: Creating a SlidingContainer Widget Using a Constructor:kony.ui.SlidingContainer

SlidingContainer Widget

The SlidingContainer widget is a hamburger menu. You use a SlidingContainer widget to create a top-level navigation experience that adapts to different screen widths.

SlidingContainer widget is applicable only for Windows 10 platform and can be created only through code.

Following are a few real-time use cases of SlidingContainer widget:

The SlidingContainer widget capabilities can be broadly categorized into the following:

Layout

Properties Description
bottom Determines the bottom edge of the widget and is measured from the bottom bounds of the parent container.
centerX Determines the center of a widget measured from the left bounds of the parent container.
centerY Determines the center of a widget measured from the top bounds of the parent container.
height Determines the height of the widget and measured along the y-axis.
left Determines the lower left corner edge of the widget and is measured from the left bounds of the parent container.
maxHeight Specifies the maximum height of the widget and is applicable only when the height property is not specified.
maxWidth Specifies the maximum width of the widget and is applicable only when the width property is not specified.
right Determines the lower right corner of the widget and is measured from the right bounds of the parent container.
top Determines the top edge of the widget and measured from the top bounds of the parent container.
width This property determines the width of the widget and is measured along the x-axis.
zIndex Specifies the stack order of a widget.

 

UI Appearance

Properties Description
margin Specifies the space around a widget.
marginInPixel Specifies whether the margin is applied in percentage or in pixels.
menuIconSkin Specifies the font skins of the menuIcon.
menuSkin Specifies the skin of the menu bar for the default hamburger menu.
showMenu Enables or disables the default hamburger menu.
widgetAlignment Indicates how a widget is to be anchored with respect to its parent.

 

Command Panel

Events Description
commandPanelClosed Invoked by the platform when the command panel is closed.
commandPanelClosing Invoked by the platform when the command panel is about to close.
 
PropertiesDescription
commandPanel Gets or sets the box or flex container that controls the navigation in the contentPanel.
commandPanelCompactWidthSpecifies the size of the commandPanel when it is closed and the display mode is compact type.
commandPanelExpandedWidthSpecifies the size of the commandPanel when it is open.
commandPanelPositionGets or sets the command panel position.
commandPanelSkinSpecifies the skin for the commandPanel of the SlidingContainer Widget.
contentPanelGets or sets a box or flex container that has complex content.
openCommandPanel Opens or closes the command panel.

Enabling RTL

PropertiesDescription
retainContentAlignmentHelps to retain the content alignment of the widget while applying RTL.
retainFlexPositionPropertiesHelps to retain the left, right and padding properties while applying RTL.
retainFlowHorizontalAlignmentEnables you to change the horizontal flow of the widget from left to right.

Miscellaneous

Propertiesdescription
cacheMode Enables or disables the cache underlying the OS UI element when the contentPanel content is changed.
menuText Gets or sets the default menu icon text.
TitleGets or sets the default menu title.
menuDisplayModeGets or sets the display mode of the menu.

SlidingContainer Widget Basics

Note: The SlidingContainer Widget is supported in Windows 10 only.

The widget is a container with two views. One view is for the main content, and the second view is used for navigation commands. The following image shows the main content view of the widget.

The following image of the open widget shows the navigation commands.

The SlidingContainer has two areas of content: a commandPanel and a contentPanel.

The contentPanel area is always present and can contain a single child element, typically a Box- or Flex-derived container that contains additional child elements.

Although the contentPanel is always present, it can be completely covered by the commandPanel. You use the properties of the SlidingContainer Widget to change the appearance and behavior of the commandPanel. For example, you can:

Creating a SlidingContainer Widget Using a Constructor:kony.ui.SlidingContainer

You can create a SlidingContainer Widget dynamically using JavaScript code.


var container = new kony.ui.SlidingContainer(allConf);

or


var container = new kony.ui.SlidingContainer(basicConf, layoutConf, pspConf);

Important Considerations

premCopyright © 2012 Kony, Inc. All rights reserved.
premCopyright © 2012 Kony, Inc. All rights reserved.