flex datagrid 显示数据库中的图片
1个回答
展开全部
[Bindable]
[Embed(source='../../../../assets/p2.gif')] //图片来源
public var alarm1:Class;
protected functiononComplete(event:FlexEvent):void
{
dataProvider=new ArrayCollection([{image1:imgObject,content:"一级"},{image1:imgObject2,content:"二级"},{image1:imgObject3,content:"三级"},{image1:imgObject4,content:"四级"}]);
legendDG.dataProvider=dataProvider;//绑定
}
<mx:DataGrid id="legendDG" height="100%" width="100%" >
<mx:columns>
<mx:DataGridColumn headerText="图例" dataField="image">
<mx:itemRenderer>
<fx:Component>
<mx:Image height="20" source="{data.image1}">
</mx:Image>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="级别" dataField="content">
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
[Embed(source='../../../../assets/p2.gif')] //图片来源
public var alarm1:Class;
protected functiononComplete(event:FlexEvent):void
{
dataProvider=new ArrayCollection([{image1:imgObject,content:"一级"},{image1:imgObject2,content:"二级"},{image1:imgObject3,content:"三级"},{image1:imgObject4,content:"四级"}]);
legendDG.dataProvider=dataProvider;//绑定
}
<mx:DataGrid id="legendDG" height="100%" width="100%" >
<mx:columns>
<mx:DataGridColumn headerText="图例" dataField="image">
<mx:itemRenderer>
<fx:Component>
<mx:Image height="20" source="{data.image1}">
</mx:Image>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
<mx:DataGridColumn headerText="级别" dataField="content">
</mx:DataGridColumn>
</mx:columns>
</mx:DataGrid>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询