flex4 datagrid中添加超鏈、輸入框、下拉框、選擇按鈕

----datagrid中加超鏈接及其觸發方法,
<mx:DataGridColumn headerText="項目編號" dataField="ProjectNo">
<mx:itemRenderer>
<fx:Component>
<mx:LinkButton label="{data.ProjectNo}" color="red"  textDecoration="none"  click="outerDocument.clickProjectNoEvent(data)"/>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>

----datagrid中加按鈕及觸發方法,CONFIRM_FLAG爲一條記錄的字段
<mx:DataGridColumn width="80" headerText="操作" >
<mx:itemRenderer>
<fx:Component>
<mx:Button label="確認" click="outerDocument.confirmBtn_ClickHandler(event)" enabled="{data.CONFIRM_FLAG}"/>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>




----datagrid中加輸入框及觸發方法,CONFIRM_FLAG爲一條記錄的字段
<mx:DataGridColumn width="80" headerText="備註" dataField="DESC_AREA" >
<mx:itemRenderer>
<fx:Component>
<mx:TextInput focusOut="textinput1_focusOutHandler(event)" editable="{data.CONFIRM_FLAG}" >
<fx:Script>
<![CDATA[
protected function textinput1_focusOutHandler(event:FocusEvent):void
{
// TODO Auto-generated method stub
data.DESC_AREA = text;
}
]]>
</fx:Script>
</mx:TextInput>

</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>




----datagrid中列中加下拉框及觸發方法,CONFIRM_FLAG爲一條記錄的字段
<mx:DataGridColumn  width="85" dataField="OTHER_PLACE_FLAG_NEW" headerText="確認後的異地行標誌"  headerWordWrap="true" >
<mx:itemRenderer>
<fx:Component>
<ns:MyComboBox showClearButton="false" selectedValue="{data.OTHER_PLACE_FLAG_NEW}" dict="YES_OR_NOT" change="mycombobox1_changeHandler(event)" enabled="{data.CONFIRM_FLAG}">
<fx:Script>
<![CDATA[
import mx.events.ListEvent;

protected function mycombobox1_changeHandler(event:ListEvent):void
{
// TODO Auto-generated method stub
data.OTHER_PLACE_FLAG_NEW = value ;
}
]]>
</fx:Script>
</ns:MyComboBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>



---datagrid中加checkBox
<mx:DataGridColumn width="180" dataField="branchCusNo" textAlign="center" headerText="分行主管客戶經理">
<mx:itemRenderer>
<fx:Component>
<mx:HBox horizontalAlign="center" horizontalGap="5">
<s:CheckBox  selected="{data.branchCusNo}"
click="data.branchCusNo=data.branchCusNo" change="outerDocument.branchCheckBox_ClickHandler()"/>
<s:Label text="{data.CUS_MANAGE_NAME}" width="50"/>
</mx:HBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>




---datagrid中加輸入框
 <mx:DataGrid id="_Grid" y="0" width="100%" x="0" height="100%" itemEditEnd="validateItem(event)" dataProvider="{list}" textAlign="center" editable="true" fontSize="12">
 <mx:columns>
  <mx:DataGridColumn headerText="數字" dataField="num"/>
  <mx:DataGridColumn headerText="非空" dataField="notNull"/>
  <mx:DataGridColumn headerText="任意" dataField="any"/>
 </mx:columns>
 </mx:DataGrid>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章