加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex4之DataGrid之ComboBox渲染器

发布时间:2020-12-15 01:04:51 所属栏目:百科 来源:网络整理
导读:在使用dataGrid时候,有时候会用到渲染器,比如我要使用comboBox做多项选择操作,我就要用到ItemRender. 在flex4中我使用fx:compoment嵌入mx:comboBox组件。 代码如下: mx:itemEditor fx:Componentmx:ComboBox width="130" labelField="label" dataProvider

在使用dataGrid时候,有时候会用到渲染器,比如我要使用comboBox做多项选择操作,我就要用到ItemRender.

在flex4中我使用<fx:compoment>嵌入<mx:comboBox>组件。

代码如下:

<mx:itemEditor>                      
					<fx:Component>
						<mx:ComboBox width="130" labelField="label" dataProvider="{outerDocument.dayTypeArr}" 
									 selectedIndex="{data.flag}" change="{data.flag = selectedIndex}"/>                
					</fx:Component>
				</mx:itemEditor>     

当然这个部分还要加到DataGrid中去。

<mx:DataGrid id="myDataGrid" width="800" editable="true" dataProvider="{initDataGrid}">
		<mx:columns>          
			<mx:DataGridColumn headerText="Id" dataField="Id" editable="false" width="200"/>
			<mx:DataGridColumn headerText="city" dataField="city" editable="false" width="200"/>
			<mx:DataGridColumn headerText="provice" dataField="provice" editable="false" width="200"/>
			<mx:DataGridColumn headerText="total" dataField="total" editable="false" width="200"/>
			<mx:DataGridColumn headerText="Year" editable="true">
				<mx:XXX>                      
					
						。。。。。。。。。。。。。。。。。。
					
				</mx:XXX>          
			</mx:DataGridColumn>
		</mx:columns>
	</mx:DataGrid>  

数据源我这里使dayTypeArr

如下所示:

[Bindable]
public var dayTypeArr:ArrayCollection = new ArrayCollection( 
	[ 
		{label:"工作日",data:1},{label:"公休日",data:2},{label:"节假日",data:3} 
	]); 
(待续....)

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读