flex tree 添加右键菜单
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontSize="12">
<mx:Script>
<!--[CDATA[
import mx.controls.Alert;
public var newBuildMenuItem:ContextMenuItem;//菜单项变量
private function init(): void//初始化函数
{
createTreeMenuItem();
tree.contextMenu = getTreeContxtMenu();
}
public function createTreeMenuItem(): void//菜单项创建函数,并添加菜单监听器
{
newBuildMenuItem = new ContextMenuItem("新建");
newBuildMenuItem.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, newBuildHandler2);
}
private function getTreeContxtMenu(): ContextMenu//将菜单项目添加到菜单中
{
var contextMenu: ContextMenu = new ContextMenu();
contextMenu.hideBuiltInItems();
contextMenu.customItems.push(newBuildMenuItem);
return contextMenu;
}
public function newBuildHandler2(event:Event):void//点击菜单执行函数
{
Alert.show("这是新建的菜单点击后执行的函数");
}
]]-->
</mx:Script>
<mx:Tree id="tree" x="31" y="10" creationComplete="init()"></mx:Tree>
</mx:Application>
为tree添加右键菜单,也可为其他任何控件添加,但暂时没法去除右键自带的菜单项,虽然网上有办法去掉,但是感觉麻烦,大家又好办法提出来啊
相关文档:
中文在线帮助文档:http://livedocs.adobe.com/flex/3_cn/langref/
http://examples.adobe.com/flex3/componentexplorer/explorer.html。
其他网站:
http://bbs.actionscript3.cn
http://www.airia.cn
http://www.anyflex.cn/bbs
http://www.5uflash.com/flex-air
http://www.52ria.com
http:// ......
最近接触了很多东西,不停的配环境,每次版本问题都得折腾一番。
Microstrategy提供了一个Flex插件,用来开发显示报表数据的Flash模板。
利用flex开发简单报表过程:
1.安装:Microstrategy8.1
2.安装Flex Builder 2.2。
3.在Flex Builder中安装visualization builder插件
方法:将\Microstrategy\SDK\t ......
/**=========main.mxml=========*/
/* 导出excel */
private function exp():void{
if(dgEnterprise.dataProvider==null){
Alert.show("数据为空,无法导出excel","友情提示");
}else{
ExportExccel.loadDGInExcel(dgEnterprise,"/ssfxSystem/excelexport.jsp?tableName=企业信息");
}
}
/**===== ......
现在有一个工程是java web project,还有一个工程是flex工程,安装的是flex builder 4正式版。发现在修改flex工程属性的构建路径时,修改结果不能保存。 解决办法: 在.actionScriptProperties文件中,找到路径直接修改。 ......