Tag Archives: DataGrid

使用ActionScript建立DataGrid, 添加右键, 增加列, 并设定列的ItemRenderer

很多时候为了获得对组件的灵活控制, 不得不放弃MXML, 直接使用ActionScript.

Posted in ActionScript | Tagged , , , , | 6 Comments

使用ItemRenderer处理基于List容器的显示内容 [DataGrid, Tree, List等]

如Student中有一Gender_属性, 1表示男生, 2表示女生, 3表示未知, 现在有下要求: 1. 在DataGrid中不可以显示1, 2,3, 应显示 男女 [ 该功能可由LabelFunction实现], 2. 如果为男生,, 则”男生”颜色为红色, 女生颜色为默认, 未知字体大小为10号

Posted in ActionScript | Tagged , , | Leave a comment

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

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

Posted in AIR | Tagged , , , , , | 4 Comments

使用labelFunction处理DataGrid显示内容

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

Posted in Flex | Tagged , , | 3 Comments

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

如下, 在没有点击[默认]是, 后两个button的enable=false;
image
点击一个之后:
image
简单实现方法:
_dataGridStudent.addEventListener(ListEvent.CHANGE, onSlectedChange);
对应监听函数:

_actionEd

More…

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