[Flex] Component Tree Series--Prevents users from clicking on any of the nodes selected in the tree

Source: Internet
Author: User

Mxml

1 <?XML version= "1.0" encoding= "Utf-8"?>2 <!--function Description: Prevents the user from clicking on any node in the tree selected -3 <s:applicationXmlns:fx= "http://ns.adobe.com/mxml/2009" 4 xmlns:s= "Library://ns.adobe.com/flex/spark" 5 xmlns:mx= "Library://ns.adobe.com/flex/mx"MinWidth= "955"MinHeight= "All"6 BackgroundColor= "0xFFFFFF"Creationcomplete= "Application1_creationcompletehandler (event)">7  <Fx:script>8   <! [Cdata[9 import mx.events.FlexEvent;Ten import mx.events.ListEvent; One     A protected function Tree_itemclickhandler (event:listevent): void -    { - var item:object = Event.currentTarget.selectedItem; the var Nonselectable:boolean = ((Item.hasownproperty ("@clickEnabled")) && (item. ( @clickEnabled = = "false" ))); - if (nonselectable) { - tree.selecteditem = null; -     } +    } -     + protected function Application1_creationcompletehandler (event:flexevent): void A    { at tree.openitems = data.actor[0]; -    } -     -   ]]> -  </Fx:script> -  <fx:declarations> in   <!--Place non-visual elements (such as services, value objects) here - -   <Fx:xmlID= "Data"xmlns=""> to    <Data> +     <actorlabel= "Stephen Chow Chi"clickenabled= "false"> -      < Yearlabel= "1988"> the       <Itemlabel= "Thunderbolt Pioneer" Hong Kong box office 8916612 "clickenabled= "false"/> *       <Itemlabel= "Catch the Wind Man" Hong Kong box office 3149395 " /> $       <Itemlabel= "best son-in-law" Hong Kong box office 5807710 />Panax Notoginseng      </ Year> -      < Yearlabel= "1989"> the       <Itemlabel= "Dragon in Tianya" Hong Kong box office 6809853clickenabled= "false"/> +       <Itemlabel= "The 7913329 of the Brave" Hong Kong box office /> A       <Itemlabel= "Rogue Poor woman" Hong Kong box office 5624622 " /> the       <Itemlabel= "The Wind and rain is the same" Hong Kong box office 9335299 /> +      </ Year> -      < Yearlabel= "1990"> $       <Itemlabel= "Steve Chan" Hong Kong box office 13703364 " /> $       <Itemlabel= "Curry pepper" Hong Kong box office 15777856 " /> -       <Itemlabel= "The Thief Star" Hong Kong box office 7968106 " /> -       <Itemlabel= "Brother hit ghost" Hong Kong box office 12128944clickenabled= "false"/> the       <Itemlabel= "Gambling holy" Hong Kong box office 41326156 " /> -       <Itemlabel= "The Invincible Lucky Star" Hong Kong box office 18799869 " />Wuyi       <Itemlabel= "The last big guy in the lake", Hong Kong box office 5495811 /> the      </ Year> -     </actor> Wu     <actorlabel= "Jet Li"> -      < Yearlabel= "1992"> About       <Itemlabel= "The Oriental Invincible (1992) of the Lake of laughter"clickenabled= "false" /> $       <Itemlabel= "Huang Fei Hong's two men as self-Improvement (1992)" /> -       <Itemlabel= "Wong Fei Hong's Three Lions King (1992)" /> -      </ Year> -      < Yearlabel= "1993"> A       <Itemlabel= "Fangshiyu Ⅱ (1993)" /> +       <Itemlabel= "The Demon-1993 of the Dragon Slayer" /> the       <Itemlabel= "Yellow Fei Hong's Iron Chicken Bucket Centipede (1993)" /> -       <Itemlabel= "Taiji Zhang Sanfeng (1993)" /> $      </ Year> the      < Yearlabel= "1994"> the       <Itemlabel= "New Shaolin Five Zu (1994)" /> the       <Itemlabel= "Hero (1994)" /> the       <Itemlabel= "Zhongnanhai Bodyguard (1994)" /> -       <Itemlabel= "A Letter to Papa (1995" ) /> in      </ Year> the      < Yearlabel= "1995"> the       <Itemlabel= "cholinergic Dragon (1995)" /> About       <Itemlabel= "A Letter to Papa (1995" ) /> the      </ Year> the     </actor> the    </Data> +   </Fx:xml> -  </fx:declarations> the  <Mx:treeID= "Tree"Dataprovider= "{Data}"LabelField= "@label"Showroot= "false"width= " the"RowCount= "8"ItemClick= "Tree_itemclickhandler (event)"/>Bayi </s:application>

[Flex] Component Tree Series--Prevents users from clicking on any of the nodes selected in the tree

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.