This content has been marked as final. Show 3 replies
The easiest way to get around this issue is to reformat your XML to something like this:
<field label="street" width="50" height="50"/>
Changing the 'width' and 'height' elements to attributes changes the way the Tree handles the data. Just make sure that you understand that your tree has a labelField predefined to "label".
eg., <mx:Tree dataProvider="BlahBlah" labelField="@label"/>
This is why other attributes wont show up in the tree. That particular issue had me scratching my head for some time :-(
Reformatting isn't really an option. Well, I suppose it is but it isn't really one I want to consider as the data is quite a bit more complicated than what I presented. Each field has additional tags below (as in my example) but, further to that tags below the field tag have tags below them. There is a complex permissions and restrictions scheme that each field adheres to depending on the user and or type of user. Additionally there are field flags wich describe the type of content in the field, each field can have anywhere from 1 to x type flags.
Essentiall i've got very structured data thats perfect for a heirechal model view but, i only want to display some of that heirarchy in my tree. The rest of the data is used elsewhere in the same editor that I'm building and using the same xml for databinding.
Thanks for the suggestions though, it's already something that I have spent some serious time thinking about.
My next suggestion is to create a second data structure using your existing XML as the source. So you have one for the data and one for the tree. The E4X model makes it really easy to create XML structures.
If you think of another way then please post it.