加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex 中点击Tree 获取点中的值

发布时间:2020-12-15 04:42:09 所属栏目:百科 来源:网络整理
导读:? xml ? version = "1.0" ? encoding = "utf-8" ? ? mx:Application ? xmlns:mx = "http://www.adobe.com/2006/mxml" ? layout = "absolute" ? ????? width = "239" ? height = "218" ? ???? mx:Style ? ????????Alert{? ????????????font-size:12px;? ?????
    
    
  1. <?xml?version="1.0"?encoding="utf-8"?>?
  2. <mx:Application?xmlns:mx="http://www.adobe.com/2006/mxml"?layout="absolute"?
  3. ?????width="239"?height="218">?
  4. ????<mx:Style>?
  5. ????????Alert{?
  6. ????????????font-size:12px;?
  7. ????????}?
  8. ????</mx:Style>?
  9. ????<mx:Tree?x="52.5"?y="10"?height="171"?width="134"?id="tree"?labelField="@label"?
  10. ?????????change="tree_change(event)"?fontSize="12">?
  11. ????????<mx:dataProvider>?
  12. ????????????<mx:XMLList>?
  13. ????????????????<province?label="广东省">?
  14. ????????????????????<city?label="广州市"/>?
  15. ????????????????????<city?label="深圳市"/>?
  16. ????????????????</province>?
  17. ????????????????<province?label="湖北省">?
  18. ????????????????????<city?label="武汉市"/>?
  19. ????????????????????<city?label="襄樊市"/>?
  20. ????????????????</province>?
  21. ????????????</mx:XMLList>?
  22. ????????</mx:dataProvider>?
  23. ????</mx:Tree>?
  24. ????<mx:Script>?
  25. ????????<![CDATA[?
  26. ????????????import?mx.controls.Alert;?
  27. ????????????private?function?tree_change(event:Event):void{?
  28. ????????????????var?str:String=tree.selectedItem.@label;?
  29. ????????????????Alert.show(str);?
  30. ????????????}?
  31. ????????]]>?
  32. ????</mx:Script>?
  33. </mx:Application>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读