2014-02-06 42 views
-1
<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> 

这是我的代码。我想将血型值添加到数据网格中。我想添加组合框中的选择到flex中的数据网格

+0

没有更多的细节,这感觉过于宽泛,不太可能帮助未来的读者,所以我投票结束。 – halfer

回答

0
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> 
+0

你是在回答你的问题吗? – Makoto

+0

是的,我得到的答案,所以只是我张贴 – chethan

相关问题