Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 974273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:24:36+00:00 2026-05-16T03:24:36+00:00

I am having some trouble with the flex Tree control. I have a control

  • 0

I am having some trouble with the flex Tree control.
I have a control in my system and of course it is data driven.

I have a group which shows a folder icon and that’s fine but it also shows an expand icon when the item has no children.

I don’t what it to show the expand icon when the group has no children but I do want to show the folder icon, because it is different entities in my system.

here’s an example of what I’m talking about. I still want to show the folder icon, the expand Icon should be hidden in this case only for the child icon.

alt text

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T03:24:37+00:00Added an answer on May 16, 2026 at 3:24 am

    It’s easy to get this problem if you’re trying to use a non-XML data provider (e.g. setting the dataProvider property of the Tree to a structure of nested ArrayCollections). In that case, the trick is to give each node a children() function that returns null (as opposed to an empty set) if there are no children.

    However, assuming you’re using a plain old XMLListCollection, what are you doing to make it display a folder icon at all? If you’re giving the node an empty set of children, then once again, the expand icon will be displayed. The list of child nodes must be null. Alternatively, if you set the isBranch property of the node to true, it will display ‘incorrectly’ as you have it above.

    The easiest way to display a folder icon without the expand icons is to just replace all the (really rather ugly) default icons with your own, which gives you complete control of how they appear. What you would do is set three properties: defaultLeafIcon, folderClosedIcon, and folderOpenIcon (good example at Flex Examples):

    [Embed(source="folder.png")]
    public var iconFolder:Class;
    
    [Embed(source="folder.png")]
    public var iconFolderOpen:Class;
    
    <mx:Tree dataProvider="{yourData}"
        defaultLeafIcon="{iconFolder}"
        folderClosedIcon="{iconFolder}"
        folderOpenIcon="{iconFolderOpen}" />
    

    I see you’re already using the Silk icon set, which has a rather nice closed folder icon. For some reason it doesn’t contain an open folder icon though, but you can just use a closed one or anything else.

    You could also just use an iconFunction (Flex Examples again), though I think the approach above is easier for what you’re trying to achieve.

    If it’s none of those problems, give us a bit more detail on the content of your data provider and existing tree properties and see if we can’t figure it out then. Hope that helps a bit anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.