ButtonMenuViewModel

AMD: require(["geoscene/widgets/FeatureTable/Grid/support/ButtonMenuViewModel"], (ButtonMenuVM) => { /* 代码 */ });
ESM: import ButtonMenuVM from "@geoscene/core/widgets/FeatureTable/Grid/support/ButtonMenuViewModel";
类: geoscene/widgets/FeatureTable/Grid/support/ButtonMenuViewModel
继承于: ButtonMenuViewModel Accessor
起始版本: GeoScene API for JavaScript 4.22

为 esri/widgets/ButtonMenuItemConfig 微件提供逻辑。

示例:
示例代码:
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
      }
    }]
  }
});

构造函数

new ButtonMenuViewModel(properties)
参数:
properties Object
optional

所有可传入构造函数的属性,请参见属性列表

属性列表

可以设置、检索或监听的属性。参见 使用属性
展示继承属性 隐藏继承属性
属性 类型 描述
String更多信息

类名。

更多信息Accessor
ButtonMenuItem[]更多信息

一组单独的菜单项

更多信息ButtonMenuViewModel
Boolean更多信息

指示菜单内容是否可见。

更多信息ButtonMenuViewModel

属性详细说明

declaredClass Stringreadonly inherited

类名。类的名称声明格式为 geoscene.folder.className

一组单独的菜单项

示例代码:
// 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

指示菜单内容是否可见。

默认值:false

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