Tag Archives: DataGrid

Flex: Setting Datagrid column percentWidth – 设置Datagrid 列宽度为百分比

需求: 设置DatagridColumn的Percent width

临时解决方法: 监听Datagrid的CREATION_COMPLETE事件, 在响应函数中重置Column的宽度.

效果: 参见http://cutown.com/home/reg.php, 网页内嵌入的Datagrid中, 后两列宽度为首列之外的宽度均分.

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

Flex: DataGrid使用ListEvent.ITEM_DOUBLE_CLICK监听双击事件

之前没怎么注意, 一直用MouseEvent.DOUBLE_CLICK来监听DataGrid的双击事件. 但这样会造成即使在空行双击也会激发响应.

datagridClasses.doubleClickEnabled = true;
datagridClasses.addEventListe

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

Flex: Datagrid派发ITEM_EDIT_BEGIN后因fm/focusManager为Null报错的解决方法

某DataGrid 监听Editor_BEGIN事件, 如果有数据未保存切换界面时, 会弹出Alert, 在弹出Alert之后, 确定切换界面时, DataGrid报错: DataGrid的itemEditorItemEditBeginHandler方法中: var fm:IFocusManager

Posted in ActionScript | Tagged , , , , | 1 Comment

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

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

Posted in ActionScript | Tagged , , , , | 3 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