RealGrid2 API
Interface
MenuItem

MenuItem

Warning: This API is now obsolete.

Change to PopupMenuItem

Menu Item Related Setting Information Model

Signature:

export interface MenuItem

Remarks

Objects created using the PopupMenuItem format can be converted to GridBase.onMenuItemClicked and GridBase.onContextMenuItemClicked It is used as a parameter when specifying a callback.

Or, when using GridBase.addPopupMenu(), it is in the form of menuItem among the parameters of callback.

Example

gridView.addPopupMenu("menu1", [
         {
              label: "alpha",
              callback: function(grid, menuItem, index) {
                  console.log("aa")
                  console.log(menuItem); // object of that type
                  console.log(clickData);
              }
         },
         {label: "beta"},
         {label: "gamma"}
]);

Events

PropertyTypeDescription
callbackMenuItemClickCallback called when clicked

Properties

PropertyTypeDescription
checkedbooleanWhether to check when type is “check” or “radio”
enabledbooleanClickable
groupstringWhen the menu group or type is "radio", select only one within the same group
labelstringName to be displayed in menu
parentPopupMenuParent: MenuItem object
taganyTags
typeMenuItemTypeMenu Item Type
visiblebooleanVisibility

Events Desc

callback

Callback called when clicked

Type - MenuItemClick


Properties Desc

checked

Whether to check when type is “check” or “radio”

Type - boolean


enabled

Clickable or not

Type - boolean


group

When the menu group or type is "radio", select only one within the same group.

Type - string


label

Name to be displayed in menu

Type - string


parent

Parent: MenuItem object

Type - PopupMenu


tag

tag

Type - any


type

Menu item type

Type - MenuItemType


visible

Visibility

Type - boolean