开发者

AS3 / Flex 4, hide nodes in Tree, while keeping children visible

开发者 https://www.devze.com 2023-02-11 04:53 出处:网络
I\'m displaying data from an XML file (simplified below) with an mx:Tree class in Flex.I don\'t want the array node to show up, as it distracts from what\'s important. But I need to retain it for late

I'm displaying data from an XML file (simplified below) with an mx:Tree class in Flex. I don't want the array node to show up, as it distracts from what's important. But I need to retain it for later when I copy the tree. Can I hide all array nodes while keeping children of array nodes visible? Thanks.

<property name="responses">
    &l开发者_JAVA技巧t;array>
        <object type="Type 1">
            <property name="text" value="some text"/>
            <property name="next" value="3"/>
        </object>
        <object type="Type 2">
            <property name="text" value="some text"/>
            <property name="next" value="3"/>
        </object>
    </array>
</property>


Create a custom Tree data descriptor.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/treeClasses/ITreeDataDescriptor.html


Set showRoot on your tree to false. That should take care of it.


I extended DefaultDataDescriptor and everything worked.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号