Skip navigation
Currently Being Moderated

Disable Items in a mx:Tree

Sep 5, 2012 4:16 AM

Hello,

 

I want to disable certain items in a mx:Tree based on an attribute within the data XML. How can i achieve this.

the mxml is:

 

<fx:Declarations>

       

        <s:HTTPService id="TreeXML" url="E:\\Documents and Settings\\ipw\\Desktop\\789.xml" resultFormat="e4x"/>

        <s:XMLListCollection id="menuXML" source="{TreeXML.lastResult.node}" />

    </fx:Declarations>

 

<mx:VBox label="Tree" width="100%" height="100%">

            <mx:Tree id="MyTree" width="100%" height="100%"

                     allowMultipleSelection="false"

                     columnCount="1" defaultLeafIcon="{null}" folderClosedIcon="{null}"

                     folderOpenIcon="{null}"  showRoot="false"

                     dataProvider="{menuXML}"

                     labelField="@label">               

            </mx:Tree>

</mx:VBox>

 

 

The XML is:

<?xml version="1.0" encoding="utf-8"?>

<Root>

    <node label="A" enabled="true"/>

    <node label="B" enabled="true">

        <node label="B.1" enabled="false"/>

        <node label="B.2" enabled="true"/>

    </node>

    <node label="C" enabled="false">

        <node label="C.1" enabled="false"/>

        <node label="C.2" enabled="true"/>

    </node>

</Root>

 

 

Thanks

 
Replies
  • Currently Being Moderated
    Sep 5, 2012 1:44 PM   in reply to Hitz_M

    You can try the “Disabling List Selection” post on my blog.

     

    --

    Alex Harui

    Flex SDK Team

    Adobe Systems, Inc.

    http://blogs.adobe.com/aharui

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points