[Flex] Component Tree Series--the array as Dataprovider

Source: Internet
Author: User

Mxml

<?XML version= "1.0" encoding= "Utf-8"?><!--function Description: Use array as Dataprovider -<s:applicationXmlns:fx= "http://ns.adobe.com/mxml/2009"xmlns:s= "Library://ns.adobe.com/flex/spark"xmlns:mx= "Library://ns.adobe.com/flex/mx"MinWidth= "955"MinHeight= "All">        <Fx:script>        <! [Cdata[protected function Tree_labelfunction (item:object): String {var num:string = ""                ;                if (Tree.dataDescriptor.hasChildren (item)) {num = "(" + Item.children.length + ")";            } return Item.label + num; }        ]]>    </Fx:script>        <fx:declarations>        <!--Place non-visual elements (such as services, value objects) here -        <Fx:arrayID= "Data">            <Fx:objectlabel= "Stephen Chow Chi">                <Fx:children>                    <Fx:objectlabel= "1988">                        <Fx:children>                            <Fx:objectlabel= "Thunderbolt Pioneer" Hong Kong box office 8916612 " />                            <Fx:objectlabel= "Catch the Wind Man" Hong Kong box office 3149395 " />                            <Fx:objectlabel= "best son-in-law" Hong Kong box office 5807710 />                        </Fx:children>                    </Fx:object>                    <Fx:objectlabel= "1989">                        <Fx:children>                            <Fx:objectlabel= "Dragon in Tianya" Hong Kong box office 6809853 />                            <Fx:objectlabel= "The 7913329 of the Brave" Hong Kong box office />                            <Fx:objectlabel= "Rogue Poor woman" Hong Kong box office 5624622 " />                            <Fx:objectlabel= "The Wind and rain is the same" Hong Kong box office 9335299 />                                                    </Fx:children>                    </Fx:object>                </Fx:children>            </Fx:object>            <Fx:objectlabel= "Jet Li">                <Fx:children>                    <Fx:objectlabel= "1992">                        <Fx:children>                            <Fx:objectlabel= "The Oriental Invincible (1992) of the Lake of laughter" />                            <Fx:objectlabel= "Huang Fei Hong's two men as self-Improvement (1992)" />                            <Fx:objectlabel= "Wong Fei Hong's Three Lions King (1992)" />                        </Fx:children>                    </Fx:object>                    <Fx:objectlabel= "1993">                        <Fx:children>                            <Fx:objectlabel= "Fangshiyu Ⅱ (1993)" />                            <Fx:objectlabel= "The Demon-1993 of the Dragon Slayer" />                            <Fx:objectlabel= "Yellow Fei Hong's Iron Chicken Bucket Centipede (1993)" />                            <Fx:objectlabel= "Taiji Zhang Sanfeng (1993)" />                                                    </Fx:children>                    </Fx:object>                    <Fx:objectlabel= "1993">                        <Fx:children>                            <Fx:objectlabel= "New Shaolin Five Zu (1994)" />                            <Fx:objectlabel= "Hero (1994)" />                            <Fx:objectlabel= "Zhongnanhai Bodyguard (1994)" />                            <Fx:objectlabel= "Letter to Papa" (1995) />                        </Fx:children>                    </Fx:object>                </Fx:children>            </Fx:object>        </Fx:array>    </fx:declarations>        <Mx:treeID= "Tree"Dataprovider= "{Data}"LabelField= "Label"width= " the"labelfunction= "Tree_labelfunction"/></s:application>

[Flex] Component Tree Series--the array as Dataprovider

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.