0
var contextMenu:ContextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
var contactList : ContextMenuItem = new ContextMenuItem("Add to Existing List");
contactList.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doStaticListCommand);
var newContactList : ContextMenuItem = new ContextMenuItem("Add a New List");
newContactList.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doNewStaticListCommand);
var removeContactList : ContextMenuItem = new ContextMenuItem("Remove contact from List");
removeContactList.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doRemoveListCommand);
var deletecontact:ContextMenuItem = new ContextMenuItem("Delete contact");
deletecontact.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, dodeleteconactCommand);
var TimeList : ContextMenuItem = new ContextMenuItem("Add Time Spent");
TimeList.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, doTimeListCommand);
contextMenu.customItems.push(contactList);
contextMenu.customItems.push(newContactList);
contextMenu.customItems.push(deletecontact);
contextMenu.customItems.push(removeContactList);
在flex中我完成了高级菜单,如果我点击然后显示上下文菜单项但我想隐藏特定的上下文菜单项在列表中,它是否可隐藏并在上下文菜单中显示特定项目?请参考我,我想基于如何在flex中隐藏/显示特定的上下文菜单项?
if(Application.application.contact_key==1)
{
contextMenu.customItems.push(deletecontact);
}
else
{
contextMenu.customItems.push(removeContactList);
}
contextMenu.customItems.push(TimeList);
return contextMenu;
键值在itemRenderer的
上contactListItemRenderer.as所有编码和调用数据网格状
<mx:DataGridColumn itemRenderer="com.view.Contact.ContactListItemRenderer"
dataField="fullName" headerText="Full Name" />
它不工作茱萸Creanga – 2010-04-27 07:32:05
感谢您回应我Mr.Cornel Creanga – 2010-04-27 07:41:39