易截截图软件、单文件、免安装、纯绿色、仅160KB

Flex List行背景色

 过去在对DataGrid设置行背景色时,感觉还是挺方便的,只要重写DataGrid的,如下
private var _rowColorFunction:Function;
public function set rowColorFunction(f:Function):void
{
this._rowColorFunction = f;
}
public function get rowColorFunction():Function
{
return this._rowColorFunction;
}
override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
{
if (this.rowColorFunction != null) {
if (dataIndex < this.dataProvider.length) {
var item:Object = this.dataProvider.getItemAt(dataIndex);
color = this.rowColorFunction.call(this, item, color);
}
}
super.drawRowBackground(s, rowIndex, y, height, color, dataIndex);
}

如果你还是不是很明白可以参考我以前的博客http://blog.csdn.net/terryzero/archive/2009/10/12/4657277.aspx
今天我碰到个需求是要对List行变色,由于我想DataGrid和List都是继承与ListBase,都有 override protected function drawRowBackground(s:Sprite, rowIndex:int, y:Number, height:Number, color:uint, dataIndex:int):void
这个方法,所以我就想当然,照葫芦画瓢,也重写了这个方法,但经过调试怎么也调用不到这个方法。搞的我非常费解,难道这个方法没用的啊?网上查了好久,国内没啥这方面的好文章,突然一篇国外的文章启发了我。如下
All the listy components in Flex (List, Datagrid, Tree, etc.) have a protected method called drawRowBackground which is in charge of drawing the background for a given row. You typically use it to color a given row based on some facet of the data the row represents (e.g. red background for rows with a negative bank balance).
With DataGrid, it's easy to use, just subclass DataGrid and override the method, parameterized so you can pass in a function to compute the color for each row based on the row index/data/original color/etc. With List (and since ComboBox uses a


相关文档:

flex获取url参数的一些写法

   在mxml的application类可以通过geturl获取当前url。获取url可以提供一个很好的方式对swf穿参数。在公司的项目中就大量的应用相关的技术。就和大家分享一下相关的写法,如果写不好就不要笑话哦。
   分析url参数类:
   package com.sunshine.framework.control
{
import com.sunshin ......

flex ModuleLoader ERROR记录

sdk3.2 下会有此问题.
项目中想用moduleLoader加载模块,达到模块化开发的目的.但是出现了共享变量的问题:
TypeError: Error #1034: 强制转换类型失败:无法将 Object@406e651 转换为 mx.messaging.messages.IMessage。
代码+上//   import mx.managers.PopUpManager;
//   private var popUpManage ......

flex 获得当前日期

    var formatter:DateFormatter = new DateFormatter();
    formatter.formatString = "YYYY-MM-DD JJ:NN:SS";
    Alert.show(formatter.format(new Date())); ......

BlazeDS, Flex与Java通信

1. 开发工具 : MyEclipse5.5, FlexBuilder3, Tomcat6.
2. 开发过程 :
    第一步 : 下载BlazeDS, 地址:http://opensource.adobe.com/wiki/display/blazeds/Release+Builds, 解压缩。
    第二步 : 在MyEclipse中新建WEB工程,导入依赖库:
     ......

AIR是什么?.air文件如何打开?flex如何运行air文件

1 安装Adobe AIR 运行时,和java的JVM类似。
Adobe AIR 运行时允许在桌面运行AIR应用程序,脱离游览器的束缚。
下载安装文件http://labs.adobe.com/downloads/air.html
在下载页面有样例程序(Sample Applications)http://labs.adobe.com/technologies/air/samples/
2 安装开发环境
当然我们选择开发效率最高的Flex B ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号