0

我试图让一棵树将一些节点显示为单选按钮。谁能明白为什么这不起作用?在我使用静态 XML 之后,我还需要从动态数据中创建它。

泰,弗雷德

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

<fx:Script>
    <![CDATA[
    ]]>
</fx:Script>

<fx:Declarations>
    <fx:XMLList id="treeData">
        <node label="Interfaces">
            <node label="RS485 Port 1">
                <node label="Q I/O" type="radio" radioGroup="group1"/>
                <node label="BACnet MSTP" type="radio" radioGroup="group1"/>
                <node label="MODBUS RTU" type="radio" radioGroup="group1"/>
            </node>
            <node label="RS485 Port 2">
                <node label="Q I/O" type="radio" radioGroup="group2"/>
                <node label="BACnet MSTP" type="radio" radioGroup="group2"/>
                <node label="MODBUS RTU" type="radio" radioGroup="group2"/>
            </node>
            <node label="Ethernet Port 1">
                <node label="BACnet IP"/>
                <node label="BACnet SNMP"/>
                <node label="Modbus TCP"/>
            </node>
            <node label="Ethernet Port 2">
                <node label="BACnet IP"/>
                <node label="BACnet SNMP"/>
                <node label="Modbus TCP"/>
            </node>             
        </node>
        <node label="Devices">
            <node label="RS-485 Port 1">
                <node label="Quest I/O">
                    <node label="Add...">
                    </node>
                    <node label="Universal Input 1">
                    </node>
                    <node label="Universal Input 2">
                    </node>
                </node>
                <node label="BACnet MSTP">
                    <node label="Add...">
                    </node>
                </node>                 
                <node label="MODBUS RTU">
                    <node label="Add...">
                    </node>
                </node>
            </node>
            <node label="RS-485 Port 2">
                <node label="Quest I/O">
                    <node label="Add...">
                    </node>
                </node>
                <node label="BACnet MSTP">
                    <node label="Add...">
                    </node>
                </node>                 
                <node label="MODBUS RTU">
                    <node label="Add...">
                    </node>
                </node>
            </node>
        </node>
        <node label="Points">
            <node label="Inputs">
                <node label="Universal Input 1">
                    <node label="Add...">
                    </node>
                    <node label="Front Door Sensor">
                    </node>
                </node>
                <node label="Universal Input 2">
                    <node label="Add...">
                    </node>
                </node>
            </node>
            <node label="Outputs">
                <node label="Add...">
                </node>
            </node>
            <node label="Schedule">
                <node label="Add...">
                </node>
            </node>
            <node label="Calendar">
                <node label="Add...">
                </node>
            </node>
            <node label="String">
                <node label="Add...">
                </node>
            </node>
        </node>
    </fx:XMLList>
</fx:Declarations>

<mx:Tree id="myTree" width="762" height="100%" labelField="@label"
         showRoot="true" dataProvider="{treeData}" />

4

0 回答 0