关于flex中tree的事件,展开事件
(1)tree点击事件public function handleList(ev:ResultEvent)
{
sourceList=ev.result as ArrayCollection;
}
private function tree_itemClick(evt:ListEvent):void {
var item:Object = Tree(evt.currentTarget).selectedItem;
if (pmtree.dataDescriptor.isBranch(item)) {
pmtree.expandItem(item, !pmtree.isItemOpen(item), true);
}
Alert.show(item["id"].toString());
}
(2) 自动展开
Tree. openItems=数据源; 即可
(3) Flex中如何利用dataDescriptor和labelFunction属性,以及hasChildren()和getChildren()函数设置Tree中包含子节点个数。1. <?xml version="1.0" encoding="utf-8"?>
2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
3. layout="vertical"
4. verticalAlign="middle"
5. backgroundColor="white">
6.
7. <mx:Script>
8. <!--[CDATA[
9. private function tree_labelFunc(item:XML):String {
10. var label:String = item.@label;
11. if (tree.dataDescriptor.hasChildren(item)) {
12. label += " (" + tree.dataDescriptor.getChildren(item).length + ")";
13. }
14. return label;
15. }
16. ]]-->
17. </mx:Script>
18.
19. <mx:XML id="treeDP">
20. <root>
21. <node label="i) One" />
22. <node label="i) Two" />
23. <node label="i) Three" />
24. <node label="i) Four">
25. <node label="ii) One" />
26. <node label="ii) Two" />
27. <node label="ii) Three">
28. <node label="iii) One" />
29. <node label="iii) Two" />
30. </node>
31. <node label="ii) Four" />
32. </node>
33.
相关文档:
Flex支持的样式设置方式
1.直接使用CSS文件,系统默认使用default.css
<mx:Style source=“style.css”/>
2.使用<mx:Style>标签
3.使用style设计器(->MXML)
4.使用对象的getStyle( )和setStyle( )
5.使用StyleManager类
主题是一套配置完成的样式风格
Flex提供的几种主题,文件类型.swc
......
var login:infoChange=infoChange(PopUpManager.createPopUp( this, infoChange , true));
login.x=250;
login.y=150;
login.userid.text=dg.selectedItem.aa;
login.username.text=dg.selectedItem.bb;
......
<?xml version=
"1.0"
encoding=
"utf-8"
?>
<mx:Application xmlns:mx=
"http://www.adobe.com/2006/mxml"
xmlns:assql=
"com.maclema.mysql.mxml.*"
& ......
import flash.display.DisplayObject;
import mx.core.Application;
import mx.managers.PopUpManager;
var win:TestWindows= PopUpManager.createPopUp(DisplayObject(Application.application),TitleWindows,true) as TitleWindows;
PopUpManager.centerPopUp(win); ......
本文编译后的补丁下载链接 http://download.csdn.net/source/1908278
多模块应用,每加载一个模块都会重复加载模块所使用的RSL,现在增加一个
private static var loadedRSLs:Dictionary = new Dictionary(); 来保存是否已加载
mx.core.RSLListLoader
//////////////// ......