sidenav
(part of package 'Servoy Extra Components') Extends designtime/SolutionModel: JSWebComponent Extends runtime: RuntimeWebComponent
This is a reference page; many components have detailed usage guides here.
Properties
animate
Type: boolean Default Value: true
containedForm
Type: form
enabled
Type: enabled Default Value: true
footerForm
Type: form
headerForm
Type: form
iconCloseStyleClass
Type: styleclass Default Value: "fa fa-bars"
iconCollapseStyleClass
Type: styleclass Default Value: "fa fa-caret-down"
iconExpandStyleClass
Type: styleclass Default Value: "fa fa-caret-right"
iconOpenStyleClass
Type: styleclass Default Value: "fa fa-bars"
location
Type: point
menu
Type: MenuItem[] Default Value: []
open
Type: boolean Default Value: true
relationName
Type: relation
responsiveHeight
Height of the container, set only in responsive forms.
Type: int Default Value: 0
scrollbarPosition
Type: string Default Value: "left"
servoyMenu
Type: JSMenu
sidenavWidth
Width of the container
Type: int Default Value: "300"
slideAnimation
Type: string Default Value: "slide-menu"
slidePosition
Type: string Default Value: "left"
styleClass
Type: styleclass
tabSeq
Type: tabseq
togglePosition
Type: string Default Value: "fixed-toggle"
visible
Type: visible
Events
onMenuItemCollapsed(menuItemId,event)
Parameters:
onMenuItemExpanded(menuItemId,event)
Parameters:
onMenuItemSelected(menuItemId,event)
@return {boolean}
Parameters:
Returns: {boolean}
onOpenToggled(event)
Parameters:
{JSEvent} event
API
addMenuItem(menuItem,menuItemId,index)
Add a menu item. The menu is added as sub Menu Item if a menuItemId is provided, otherwise is added in root. If index is provided the menu is added at the specified index position, otherwise is added as last element. Return false if menuItemId cannot be found.
@public @param {String} [menuItem.iconStyleClass] use style classes to display icons as Font Icons, optional. example 'glyphicon glyphicon-search'. @param {Boolean} [menuItem.enabled] menuItem cannot be selected or expanded if disabled, optional. Default true. @param {Object} [menuItem.data] data object can be used to add custom properties to the menuItem, optional. For example you may set the formName to be shown when the menuItem is selected { formName: "aFormName", description: "This menu item will open the given form" } @param {Array} [menuItem.menuItems] an array of nested menuItems, optional. @param {Boolean} [menuItem.isDivider] if true render a divider into the menu instead of a menuItem, optional. All other properties are ignored. Default false. @param {String|Number} [menuItemId] add the item as subMenuItem of the menuItemId, optional. Default add the menuItem as root. @param {Number} [index] 0-based. The index at which to insert the item. Optional. Index value should not be greater then number of sibelings. Default is at the end. Example:
Parameters:
Returns: boolean
clearMenuItems(depth)
Remove all the menu items. If depth is specified removes all the menu items at depth. If depth is equal to 1 all roots will be removed. Default depth is 1.
@public Example:
Parameters:
{int} [depth] 1-based. Default 1.
getLocation(menuItemId)
Retrieves the screen location of a specific menu item. Returns the location as point (object with x and y properties).
Parameters:
{object} menuItemId NodeId the node to retrieve location for.
Returns: point Location of the menu item.
getMenuItem(menuItemId)
Returns the menuItem object
@public
Parameters:
{object} menuItemId MenuItemId
Returns: MenuItem
getParentMenuItem(menuItemId)
Returns the parent menuItem object of the menu item with id menuItemId
@public
Parameters:
{object} menuItemId MenuItemId
Returns: MenuItem
getRootMenuItems()
Returns the root menu object
@public
Returns: MenuItem[]
getSelectedMenuItem(level)
Returns the selected menuItem.
@public
Parameters:
{int} [level] If level is provided search for the selected menu item at level.
Returns: MenuItem
getSize(menuItemId)
Retrieves the size of a specific menu item. Returns the size as dimension (object with width and height properties).
Parameters:
{object} menuItemId NodeId the node to retrieve size for.
Returns: dimension Size of the menu item.
getSubMenuItems(menuItemId)
Returns the sub menu items of the menu item with id 'menuItemId'
@public
Parameters:
{object} menuItemId MenuItemId
Returns: MenuItem[]
isMenuItemEnabled(menuItemId)
Returns true if the menuItem and all it's ancestors are enabled. Return false if menuItemId cannot be found. *NOTE: The method returns false if any ancestor of the menuItem is not enabled; if the property enabled of the menuItem is set to true, but has a parent with the enabled property set to false, then isMenuItemEnabled returns false. *
@public
Parameters:
{object} menuItemId MenuItemId
Returns: boolean
isMenuItemExpanded(menuItemId)
Returns true if the menuItem is expanded.
@public
Parameters:
{object} menuItemId MenuItemId
Returns: boolean
removeMenuItem(menuItemId)
Remove the menu item and all it's subMenuItems from the tree. Return false if menuItemId cannot be found.
@public
Parameters:
{object} menuItemId MenuItemId
Returns: boolean
removeSubMenuItems(menuItemId)
Remove all the sub menu items of the menu item with id 'menuItemId' Return false if menuItemId cannot be found.
@public
Parameters:
{object} menuItemId MenuItemId
Returns: boolean
setMenuItemEnabled(menuItemId,enabled)
Enable or disable the menuItem Return false if menuItemId cannot be found.
@public
Parameters:
Returns: boolean
setMenuItemExpanded(menuItemId,expanded,mustExecuteOnMenuItemExpand)
Force the menuItem to be expanded or collapsed. Return false if menuItemId cannot be found or is disabled.
@public
Parameters:
Returns: boolean
setRootMenuItems(menuItems)
Init the menu setting the root menuItems.
@public Example:
Parameters:
{MenuItem[]} menuItems >} menuItems is an array of MenuItem objects. Each MenuItem object should set the required properties 'id', which uniquely identifies the menuItem object in menu, and 'text' property. The MenuItem may contain the optional properties 'styleClass', 'iconStyleClass', 'data', 'enabled', 'menuItems', 'isDivider'
setSelectedMenuItem(menuItemId,mustExecuteOnMenuItemSelected,mustExecuteOnMenuItemExpand,level)
Select the menu item with the given id. If level is provided search is optimized since it will search only within the descendant of the selected menuItem at level. For example if a root menuItem is selected and level is equal 2 search only in the subMenuItems of the selected root. Return false if menuItemId cannot be found or is disabled.
@public
Parameters:
{object} menuItemId Id
{boolean} [mustExecuteOnMenuItemSelected] Force the onMenuItemSelect to be executed. Default false.
{boolean} [mustExecuteOnMenuItemExpand] Force the onMenuItemExpand to be executed. Default false.
{int} [level] Reduce the search to the selected menuItem at level, if any menuItem is selected at level.
Returns: boolean
setSelectedMenuItemAsync(menuItemId)
@deprecated use setSelectedMenuItem(id, false, false) instead.
Select the menu item with the given id.
This function doesn't wait for a return value; use setSelectedMenuItem if you want to know if the menu item can be select successfully @public
Parameters:
{object} menuItemId Id
setSubMenuItems(menuItemId,menuItems)
Set the menuItems as sub menu items of the menu item with id 'menuItemId' Return false if menuItemId cannot be found.
@public Example:
Parameters:
{object} menuItemId MenuItemId
{MenuItem[]} menuItems >} menuItems is an array of MenuItem objects. Each MenuItem object should set the required properties 'id', which uniquely identifies the menuItem object in menu, and 'text' property. The MenuItem may contain the optional properties 'styleClass', 'iconStyleClass', 'data', 'enabled', 'menuItems', 'isDivider'.
Returns: boolean
Types
MenuItem
scripting type: CustomType<servoyextra-sidenav.MenuItem>
badgeStyleClass
Type: styleclass
Default Value: "badge text-bg-secondary"
badgeText
Type: tagstring
data
Type: object
enabled
Type: boolean
Default Value: true
formName
Type: form
iconStyleClass
Type: styleclass
id
Type: object
isDivider
Type: boolean
Default Value: false
menuItems
Type: MenuItem[]
relationName
Type: relation
styleClass
Type: styleclass
text
Type: tagstring
tooltip
Type: tagstring
Last updated