zoukankan
html css js c++ java
List 拖动数据 for Flex
在Flex中List的数据拖动只需要设置以下几个属性就行了.
dragEnabled="true"
dragMoveEnabled="true"
dropEnabled="true"
例:
<?
xml version
=
"
1.0
"
encoding
=
"
utf-8
"
?>
<
mx:Application xmlns:mx
=
"
http://www.adobe.com/2006/mxml
"
layout
=
"
absolute
"
creationComplete
=
"
init()
"
>
<
mx:Script
>
<!
[CDATA[
import
mx.controls.listClasses.ListItemRenderer;
import
mx.collections.ArrayCollection;
import
comm.
*
;
import
mx.controls.Alert;
import
mx.events.SliderEvent;
[Bindable]
private
var carArray : ArrayCollection
=
new
ArrayCollection();
private
var db:XML
=
<
object
>
<
car
>
<
Name
>
wubiyu
</
Name
>
<
Available
>
true
</
Available
>
</
car
>
<
car
>
<
Name
>
wubiyu1
</
Name
>
<
Available
>
true
</
Available
>
</
car
>
<
car
>
<
Name
>
wubiyu2
</
Name
>
<
Available
>
true
</
Available
>
</
car
>
<
car
>
<
Name
>
wubiyu3
</
Name
>
<
Available
>
true
</
Available
>
</
car
>
</
object
>
private
function init():
void
{
var car : CarVO
=
new
CarVO();
car.Name
=
"
Ford
"
;
car.Available
=
true
;
carArray.addItem(car);
car
=
new
CarVO();
car.Name
=
"
Benz
"
;
car.Available
=
true
;
carArray.addItem(car);
car
=
new
CarVO();
car.Name
=
"
BMW
"
;
car.Available
=
true
;
carArray.addItem(car);
//
List1.dataProvider = ['wubiyu1','wubiyu2','wubiyu3','wubiyu4','wubiyu5'];
//
List2.dataProvider = [];
}
private
function btn(e:Event):
void
{
var ar:ArrayCollection
=
List2.dataProvider as ArrayCollection;
for
(var i:
int
=
0
;i
<
ar.length;i
++
)
{
Alert.show(ar.getItemAt(i).Name);
}
}
private
function changeHandler(event:Event):
void
{
//
List1.dataProvider
}
private
function List2_Change(e:Event):
void
{
Alert.show(
"
dddd
"
);
}
]]
>
</
mx:Script
>
<
mx:List x
=
"
10
"
y
=
"
0
"
dragEnabled
=
"
true
"
id
=
"
List1
"
allowMultipleSelection
=
"
true
"
dropEnabled
=
"
true
"
dragMoveEnabled
=
"
true
"
width
=
"
200
"
dataProvider
=
"
{db.children()}
"
labelField
=
"
Name
"
></
mx:List
>
<
mx:List x
=
"
218
"
y
=
"
0
"
dragEnabled
=
"
true
"
id
=
"
List2
"
dropEnabled
=
"
true
"
dragMoveEnabled
=
"
true
"
allowMultipleSelection
=
"
true
"
change
=
"
List2_Change(event)
"
width
=
"
200
"
labelField
=
"
Name
"
></
mx:List
>
<
mx:Button x
=
"
156
"
y
=
"
177
"
label
=
"
Button
"
click
=
"
btn(event)
"
/>
</
mx:Application
>
查看全文
相关阅读:
从gettext来看linux下程序的internationalization
C++ Convert Operator和其他Operator的应用场景比较
申明一个函数指针,并且该函数的返回值也是一个函数指针 示例代码
XML操作大全
如何让页面延迟显示?
Ajax实现不刷屏的前提下实现页面定时刷新
我喜欢的笑话 呵呵
Atlas UpdatePanel使用技巧以及常见问题
asp.net 弹出窗体
C# asp.net操作文件
原文地址:https://www.cnblogs.com/wubiyu/p/1244852.html
最新文章
JNI操作JAVA 中的字段和方法时的效率
字符串(JNI)
fastJson解析框架的学习
ASP.NET技术的学习顺序
lib和DLL区别和联系生成DLL
Asp.net发布网站
C#开发C/S结构如何通信的问题?
生成DLL的几种方法和使用方法
ASP.NET(C#)生成DLL
DataGridView 行、列的隐藏和删除
热门文章
VS2008发布、生成网站时如何像vs2003那样生成单个dll文件
net+msmq快速访问数据库
程序集绑定日志查看器 (Fuslogvw.exe)
C语言中如何printf一个unsigned long long的数据?
Linux下编写动态链接库,如何定义一个init和finalize的方法?
从lftp的源码看memmove和memcpy的区别
趋势的C++面试题
gcc中的##表示什么?
从rtspplayer demo程序在手机上运行来看gcc的rpath, rpathlink这两个option
生成patch的diff命令是怎么写的?
Copyright © 2011-2022 走看看