ButtonMenuViewModel

AMD: require(["esri/widgets/FeatureTable/Grid/support/ButtonMenuViewModel"], (ButtonMenuVM) => { /* code goes here */ });
ESM: import ButtonMenuVM from "@arcgis/core/widgets/FeatureTable/Grid/support/ButtonMenuViewModel";
Class: esri/widgets/FeatureTable/Grid/support/ButtonMenuViewModel
Inheritance: ButtonMenuViewModel Accessor
Since: ArcGIS API for JavaScript 4.16

Provides the logic for the esri/widgets/ButtonMenuItemConfig widget.

See also:
Example:
let featureForm = new ButtonMenu({
  viewModel: { // Autocasts as new ButtonMenuViewModel()
    items: [{
      label: "custom menu item label",
      iconClass: "Icon font name, if applicable",
      clickFunction: function (event) {
       // Add custom function to perform on menu item button click
      }
    }]
  }
});

Constructors

new ButtonMenuViewModel(properties)
Parameter:
properties Object
optional

See the properties for a list of all the properties that may be passed into the constructor.

Property Overview

Any properties can be set, retrieved or listened to. See the Working with Properties topic.
Show inherited properties Hide inherited properties
Name Type Summary Class
Stringmore details

The name of the class.

more detailsAccessor
ButtonMenuItem[]more details

An array of individual menu items.

more detailsButtonMenuViewModel
Booleanmore details

Indicates if the menu content is visible.

more detailsButtonMenuViewModel

Property Details

declaredClass Stringreadonly inherited

The name of the class. The declared class name is formatted as esri.folder.className.

An array of individual menu items.

Example:
// Typical usage for ButtonMenuItem
const buttonMenuItem1 = new ButtonMenuItem ({
  label: "custom menu item label",
  iconClass: "Icon font name, if applicable",
  clickFunction: function (event) {
    // Add custom function to perform on menu item button click
  }
});

const buttonMenuItem2 = new ButtonMenuItem ({
  label: "Second custom menu item label",
  iconClass: "Second icon font name, if applicable",
  clickFunction: function (event) {
    // Add second custom function to perform on menu item button click
  }
});

// Apply the button menu items above to the button menu
const buttonMenu = new ButtonMenu ({
  iconClass: "esri-icon-left",
  items: [buttonMenuItem1, buttonMenuItem2]
});
open Boolean

Indicates if the menu content is visible.

Default Value:false

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.