-
Notifications
You must be signed in to change notification settings - Fork 115
Closed
Description
labelFunction not implemented in Tree component. The output for compiler :
D:\dev\royale-emulation-works\github\royale-testing\src\main\mtest\FindBug.mxml(73): col: 7 Error: This attribute is unexpected. It will be ignored.
labelFunction="treeLabel"
^
D:\dev\royale-emulation-works\github\royale-testing\src\main\mtest\FindBug.mxml(73): col: 7 Error: This attribute is unexpected. It will be ignored.
labelFunction="treeLabel"
^
Sample code :
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.apache.org/royale/spark"
xmlns:mx="library://ns.apache.org/royale/mx"
paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
height="100%" width="100%"
creationComplete="loadData()"
>
<fx:Metadata>
</fx:Metadata>
<fx:Script>
<![CDATA[
[Bindable]
public static var liveTreeDP:XMLList;
public function loadData():void {
liveTreeDP = PInaraData;
}
private function treeLabel(item:Object):String {
var node:XML = XML(item);
//Alert.show(node.localName());
if (node.localName() == "list") {
return node.@title;
} else if (node.localName() == "jobGroup") {
if(node.@id == "") {
// Alert.show("node : " + node);
}
return node.@title + " [Id:" + node.@id + "]";
} else if(node.localName() == "jobProperty") {
//return node.@name;
if(node.@id == "") {
// Alert.show("node : " + node);
}
return node.@title + " [Id:" + node.@id + "]";
}
return node;
}
]]>
</fx:Script>
<fx:Declarations>
<fx:XMLList id="PInaraData">
<list title="Grup Listesi" id="0">
<jobGroup title="Independents" id="-1">
<jobProperty title="SENSORDATA_HOURLY" id="1" statu="0" port="1"/>
<jobProperty title="SENSORDATA_DAILY" id="2" statu="0" port="1"/>
<jobProperty title="SENSORDATA_ALWAYSON" id="3" statu="0" port="1"/>
<jobProperty title="SENSORDATA_FIVE_MIN" id="4" statu="9" port="1"/>
<jobProperty title="PERSONAL_PROFILE_INFO" id="5" statu="9" port="1"/>
<jobProperty title="SENSORDATA_AVG_CONS" id="6" statu="9" port="1"/>
</jobGroup>
</list>
</fx:XMLList>
</fx:Declarations>
<s:layout>
<s:VerticalLayout gap="10" paddingRight="10" paddingLeft="10" paddingTop="10" paddingBottom="20" />
</s:layout>
<mx:Panel title="Tree Label Function Example"
paddingBottom="10" paddingTop="10" paddingLeft="10" paddingRight="10"
height="50%" width="50%">
<mx:Tree id="myTree" width="50%" height="100%" labelField="@title"
labelFunction="treeLabel"
showRoot="true" dataProvider="{liveTreeDP}" />
</mx:Panel>
</s:Application>
@aharui I checked the AdvancedDataGrid, AdvancedListBase and ListBase but could not find the implementation for labelFunction. I need your assistance.
Metadata
Metadata
Assignees
Labels
No labels