在 Flex 中加载和设置菜单的保存值
我在 Flex 中有一个简单的弹出菜单,即 mx 菜单,并且我使用 Menu.initMenu 来创建依赖于定义为数据提供者的 XML 列表的菜单。
菜单有复选框项目,每次我在包含菜单实例的类中调用 load(values:Array) 函数时,我想检查相关项目。
如何动态加载值并更改菜单的选择?
I have a simple popup menu in flex, a mx Menu, and I use the Menu.initMenu to create the menu relying on an XML List defined as the data provider.
The menu has check box items, and every time I call a load(values:Array) function in the class which contains the menu's instance, I want to check the relevant items.
How do I dynamically load values and change the menu's selections ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,明白了:
设置菜单,并给每个菜单项一个标签属性:
创建一个辅助函数来打开给定标签的菜单项(如果是 2 级菜单项,还提供 subMenuID,是第二个项目的标签名称):
实现一个函数初始化菜单的值:
OK, got it :
set the menu, and give EVERY menuitem a label attribute :
create an auxiliary function to turn on menuitems for a given Label (if it's a 2-level menu item, provide also the subMenuID which is the second item's label name):
implement a function that initializes the menu's values :