FLEX DATAGRID 行上移/下移
来源:互联网 发布:js excel 导入 编辑:程序博客网 时间:2024/05/20 06:54
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:Script>
<![CDATA[
import mx.collections.IList;
import mx.collections.ArrayCollection
[Bindable]
public var employees:ArrayCollection = new ArrayCollection([
{name: '丑哥哥01', phone: '13702023400', email: 'bjones@acme.com', status: 'I'},
{name: '丑哥哥02', phone: '13702023401', email: 'ssmith@acme.com', status: 'I'},
{name: '丑哥哥03', phone: '13702023402', email: 'bjones@acme.com', status: 'I'},
{name: '丑哥哥01', phone: '13702023403', email: 'ssmith@acme.com', status: 'I'},
{name: '丑哥哥05', phone: '13702023404', email: 'bjones@acme.com', status: 'I'},
{name: '丑哥哥06', phone: '13702023405', email: 'ssmith@acme.com', status: 'I'},
{name: '丑哥哥07', phone: '13702023406', email: 'bjones@acme.com', status: 'I'},
]);
public function moveUp(event : MouseEvent) : void
{
var i : int = peopleList.selectedIndex;
if(i >= 1&&peopleList.selectedItem)
{
IList(peopleList.dataProvider).addItemAt(peopleList.selectedItem,i-1);
IList(peopleList.dataProvider).removeItemAt(i+1);
peopleList.selectedIndex = i;
}
}
public function moveDown(event : MouseEvent) : void
{
var i : int = peopleList.selectedIndex;
if(i < (ArrayCollection(peopleList.dataProvider).length - 1) && peopleList.selectedItem)
{
IList(peopleList.dataProvider).addItemAt(peopleList.selectedItem,i + 2);
IList(peopleList.dataProvider).removeItemAt(i);
peopleList.selectedIndex = i; }
}
]]>
</mx:Script>
<mx:VBox horizontalAlign="center" x="618" y="176" height="264">
<mx:DataGrid id="peopleList" x="198" y="66" width="302" dataProvider="{employees}" >
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name"/>
<mx:DataGridColumn dataField="phone" headerText="Phone"/>
<mx:DataGridColumn dataField="email" headerText="Email"/>
</mx:columns>
</mx:DataGrid>
<mx:ControlBar width="298" autoLayout="true" horizontalAlign="right" height="26">
<mx:Button label="上移" click="moveUp(event)"/>
<mx:Button label="下移" click="moveDown(event)"/>
</mx:ControlBar>
</mx:VBox>
</mx:Application>
- FLEX DATAGRID 行上移/下移
- datagrid实现行的上移和下移
- datagrid上移动下移动
- Easyui datagrid行内【添加】、【编辑】、【上移】、【下移】
- Easyui datagrid行内【添加】、【编辑】、【上移】、【下移】
- Easyui datagrid行内【添加】、【编辑】、【上移】、【下移】
- Flex中List实现上移下移功能
- FLex List 实现上移下移功能
- Flex中List实现上移下移功能
- datagridview 整行上移下移
- datagridview 整行上移下移
- datagridview 选中行上移下移
- GridView 行交换 ,上移 下移
- js table 行上移、下移
- C#中DataGrid加载XML数据---上移和下移
- GridView 行交换 GridView 行上移下移
- table行的上移下移 上下移动
- table 行上移 下移 置顶 删除
- autohotkey-lab 2011-01-13 12:18:15
- (转)李开复:互联网的九个产品精神
- 域名备案状态说明,待核实 已提交至省局系统待审核 省局审核通过
- autohotkey-lab 2011-01-13 12:18:15
- 炫丽的Socket聊天室
- FLEX DATAGRID 行上移/下移
- 基础加强(概述)
- 数据库索引技术—索引介绍 (一)
- flex +jsp 文件上传
- jsp数据库分页技术
- flex +java 图形保存
- 黑马程序员复习第一天
- 数据库索引技术-聚集索引和非聚集索引介绍(二)
- thread_scheduler初始化