ButtonMenuViewModel
require(["esri/widgets/FeatureTable/Grid/support/ButtonMenuViewModel"], function(ButtonMenuVM) { /* code goes here */ });
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:
var 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 Objectoptional
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.
Name | Type | Summary | Class | |
---|---|---|---|---|
String | The name of the class. more details | more details | Accessor | |
ButtonMenuItem[] | An array of individual menu items. more details | more details | ButtonMenuViewModel | |
Boolean | Indicates if the menu content is visible. more details | more details | ButtonMenuViewModel |
Property Details
The name of the class. The declared class name is formatted as
esri.folder.className
.
- items ButtonMenuItem[]autocast
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
Loading...