Tag Archives: DataGrid

AIR中通过右键直接选定基于LIST容器[DataGrid, List, Tree等]的数据 – Select List item with mouse right-click

在很多情况下, 我们在DataGrid, List, Tree等容器中使用右键, 进行如修改, 删除 某行的操作. 问题是如果该容器初始状态下直接进行右键点击时, 并不能选定任何数据. 通过监听右键菜单SELECT事件, 获取到当前右键所击位置的Index, 并将之赋值给DataGrid或其他容器的SelectIndex, 完成点击操作

Posted in AIR | Tagged , , , , , | 2 Comments

使用labelFunction处理DataGrid显示内容

在设定了DataGrid的DataProvider, 设定DataGridColumn及其相应的DataField之后, DataGrid就可正常显示, 但有时候需要稍微处理一下显示内容: 如 某ArrayCollection中含有一组Student, Student对象具有gender属性, 其中1代表男, 2代表女, 3代表不确定. 此时需要使用labelFunction进行处理显示内容.

Posted in Flex | Tagged , , | 2 Comments

[小技巧] 通过监听DataGrid的ListEvent.Change控制button是否可用.

如下, 在没有点击[默认]是, 后两个button的enable=false;

image

点击一个之后:

image

简单实现方法:

_dataGridStudent.addEventListener(ListEvent.CHANGE, onSlectedChange);

对应监听函数:

_actionEd

Posted in ActionScript, Flex | Tagged , | Leave a comment

Flex中获得DataGrid中编辑前后的数据

问题:

在使用DataGrid进行数据编辑时, 我们不可避免的需要对数据的输入进行检验, 修正等错误.

解决方法:

监听DataGrid的editEnd事件:DataGridEvent.ITEM_EDIT_END.改事件中包含有正在编辑的DataGridColumn[列名], 编辑前的数据, 编辑结

Posted in Flex | Tagged , , | 4 Comments

ActionScript中使用自定义组件 Use CustomUI in Flex with ActionScript

一: 需求

要求使用get ui获得一个UICompontent[DataGrid], 其中DataGrid某列的ItemEditor为ComboBox,且该UICompontent的右键菜单中有一个Item: 删除 [删除当前选定的行]
使用set value 来设定该UIComponten

Posted in Flex | Tagged , , , , , | Leave a comment