Class
zebkit.ui.MenuItem
extends <zebkit.ui.Panel> |
<zebkit.ui> |
Menu item panel class. The component holds menu item content like caption, icon, sub-menu sign elements. The area of the component is split into three parts: left, right and center. Central part keeps content, left side keeps checked sign element and the right side keeps sub-menu sign element.
zebkit.ui.MenuItem
(content
)
Parameters:
-
content
<String | zebkit.ui.Panel>a menu item content string or component. Caption string can encode the item id, item icon and item checked state. For instance:
{ content: "Test" | {zebkit.ui.Panel} checked: {Boolean}, // optional group : {zebkit.ui.Group}, // optional icon : "path/to/image" | {Image}, // optional handler: {Function} // optional id : {String} // optional }
Example:
// create menu item with icon and "Item 1" title
var mi = new zebkit.ui.MenuItem({
content: "Menu item label"
});
public | <zebkit.ui.Panel> | getCheck ( ) |
public | <zebkit.ui.Panel> | getContent ( ) |
protected
|
<zebkit.ui.Panel> | getSub ( ) |
public | <Boolean> | isChecked ( ) |
public | void | itemSelected ( ) |
public | void | setGroup (g, [v]) |
public | void | setIcon (img) |
public | void | setParent (p) |
public
<zebkit.ui.Panel>
getCheck ( )
Get check state component
Returns:
<zebkit.ui.Panel>
a check state component |
public
<zebkit.ui.Panel>
getContent ( )
Get content component
Returns:
<zebkit.ui.Panel>
a content component |
protected
<zebkit.ui.Panel>
getSub ( )
Get menu item child component to render sub item arrow element
Returns:
<zebkit.ui.Panel>
a sub item arrow component |
public
void
itemSelected ( )
Callback method that is called every time the menu item has been selected. |
public
void
setGroup (g, [v] )
Set group Parameters:
|
public
chainable
setIcon (img )
Set the menu item icon. Parameters:
|
@Override
zebkit.layout.Layoutable
public void setParent (p )
Override setParent method to catch the moment when the item is inserted to a menu Parameters:
|












public
![]() gap
Gap between checked, content and sub menu arrow components |