![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
Hi,
I have tried using tree control for displaying my xml data but I had a problem that i did not have labels in my xml data. A sample xml data is attached. So it displays the whole data at each level in the tree. How do i solve this issue i,e get the tags names itself as labels.. Thanks in advance.... <CompositeData> - <AttributeData> - <CPUData> <CPUTime>32</CPUTime> </CPUData> </AttributeData> <Name>default:cimclass=SAP_ITSAMPerfProvider,type= SAP_ITSAMSystem.SAP_ITSAMProvi ders,version=1,key1=value1</Name> </CompositeData> |
| Sponsored Links |
|
|||
|
An update after some efforts..
Could get the folders perfectly i.e until the level of CPUTime perfectly but could not get the leaf: 32 since i used the following to set the label. I would like to know if there is a way to find out if a node is a leaf or folder and according set the label private function treeLabel(item:Object):String { var node:XML = XML(item); return node.localName(); } and tree : <mx:Tree x="573" y="34" id="tree" dataProvider="{xmldata}" enabled="true" labelFunction="treeLabel" width="395" height="521" itemClick="tree_itemClick(event)" variableRowHeight="true" wordWrap="true"></mx:Tree> |
|
|||
|
Ohh,,finally got it..
The following did the trick... private function treeLabel(item:Object):String{ var node:XML = XML(item); if(tree.dataDescriptor.hasChildren(item)){ return node.localName() ; } return node; } |
|
|||
|
Ohh,,finally got it..
The following did the trick... private function treeLabel(item:Object):String{ var node:XML = XML(item); if(tree.dataDescriptor.hasChildren(item)){ return node.localName() ; } return node; } |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise