apache-flex 我想将组合框中选项添加到Flex中的数据网格

wfveoks0  于 2022-11-01  发布在  Apache
关注(0)|答案(1)|浏览(132)
<mx:FormItem label="Blood:"  width="100%" >
    <s:ComboBox id="blood" prompt="Blood Group" >
        <s:dataProvider>
        <mx:ArrayList>
            <fx:String>B+ve</fx:String>
        <fx:String>A+ve</fx:String>
            <fx:String>O+ve</fx:String>
        <fx:String>O-ve</fx:String>
        <fx:String>A-ve</fx:String>
        <fx:String>B-ve</fx:String>
        </mx:ArrayList>
     </s:dataProvider>
    </s:ComboBox>
</mx:FormItem>

这是我的代码。我想把血型值添加到数据网格中。

ckx4rj1h

ckx4rj1h1#

public function adddetails():void{
if(txtname.text !=""&&txtdob.text != "")//)&&( txtEmpname !="" )&&( txtEmpphone !="")
            {
ac.addItem({Name:txtname.text, DOB:txtdob.text,
                                                                           Standard:txtstd.value,Gender:txtg.selectedItem,Blood:Bloodtype});
                //Alert.show("Form Submitted!");
                clearInputs();
}

}

<s:VGroup gap="2">
    <mx:FormItem label="Gender" width="200" required="true">
    <s:ComboBox id="txtg" width="100%" prompt="Select Gender"> 
            <s:dataProvider>
            <mx:ArrayList>
                                                          <fx:String>Male</fx:String>
                                                           <fx:String>Female</fx:String>

        </mx:ArrayList>
            </s:dataProvider>
        </s:ComboBox>
        </mx:FormItem>
    <s:Label text="The selected item is: {txtg.selectedItem}"/>
    </s:VGroup>

相关问题