flex4 datagrid里点击链接打开图片的方法
来源:互联网 发布:用myelipse写java 编辑:程序博客网 时间:2024/05/02 14:53
1. 在datagrid里面 加入链接
链接新窗口显示相关的图片
。
如下
<mx:DataGridColumn resizable="false" editable="false" headerText="查看大图" >
<mx:itemRenderer>
<fx:Component>
<mx:HBox width="100%" horizontalGap="0">
<mx:LinkButton label="查看大图" click="parentDocument.viewBigImage()" />
</mx:HBox>
</fx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
方法:
/**
* 原作查看大图 yanek 增加该方法
*/
public function viewBigImage():void{
//选中的行数
var k:int = this.originalPicList.selectedIndex;
//Alert.show("k="+k);
//获取dataGrid中的数据
var arr : Array =(originalPicList.dataProvider as ArrayCollection).source;
//获取当前选中行的dictType列的数据
var path:String = arr[k]["picUrlImage"].toString();
var path1:String = this.originalPicList.selectedItem.picUrlImage;
//Alert.show("path="+path);
var window : ViewBigImage = PopUpManager.createPopUp(this,ViewBigImage,true) as ViewBigImage;
window.owner = this;
//window.bigimage.source = path;
window.bigimage.source = path1;
PopUpManager.centerPopUp(window);//弹出子窗口
}
//////////////////////
注意:取得路径的方法 var path1:String = this.originalPicList.selectedItem.picUrlImage;
弹出新窗口代码:ViewBigImage.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" close="PopUpManager.removePopUp(this)" title="大图查看" width="681" height="498">
<s:layout>
<s:BasicLayout/>
</s:layout>
<fx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.controls.Alert;
import mx.core.Application;
import mx.managers.PopUpManager;
import mx.rpc.events.ResultEvent;
private var trme : String = Math.random().toString();
private var dtArray : ArrayCollection = new ArrayCollection();
protected function init():void{
}
protected function close_window():void{
PopUpManager.removePopUp(this);
}
]]>
</fx:Script>
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<mx:Image x="58" y="20" width="564" height="391" id="bigimage"/>
</s:TitleWindow>
- flex4 datagrid里点击链接打开图片的方法
- flex4取得datagrid里字段值的正确方法
- flex4 datagrid增加链接按钮的方法实现
- 点击左边frame里的链接在右边的frame里打开
- flex4.5的DataGrid
- Flex4 <s:DataGrid> 的用法
- 点击按钮打开 输入的链接
- 点击链接打开新窗口,并展示一张图片
- 点击文本框里弹出一个DATAGRID的控件
- DataGrid里选中Row的方法
- 点击datagrid的一行,然后链接到另一个页面
- flex4.5 DataGrid的GridItemEditor属性设置
- 打开指定文件夹里的图片
- 取得Flex4 DataGrid组件的当前选中行数据的方法
- 点击图片,跳转链接
- iOS ---点击图片的方法
- Flex4.5中datagrid加入图片image显示
- 点击一个checkbox控件,使得Datagrid里的模版里放的checkbox全部选中
- flex4取得datagrid里字段值的正确方法
- 观察者模式 java.util.Observable 与 java.util.Observer 的理解
- Oracle Sequence 清零
- C#调用C++下Win32DLL,找不到入口问题,感谢TallMan
- javascript colck
- flex4 datagrid里点击链接打开图片的方法
- 块状链表 poj2887
- 简单应用:通过经纬度获取Google天气数据
- Make your Android Listview Fast and Efficient
- How to enable the use of 'Ad Hoc Distributed Queries' by using sp_configure
- 关于ButtonListener的包导入问题
- mariadb系列0002-- window服务
- 心血来潮装了了ubuntu 11.04
- 刷机入门 手把手教程