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

about Flex DataGrid edit

Summary(概述): Adobe Flex 的 dataGrid 有很强大的功能,比如ItemRenderer,headerRenderer等,可以方便地实现自己想要的功能。但对dataGrid直接编辑并保存到Service端,就有点麻烦了。
Requirement(需求): 对dataGrid进行单位格编辑,若有变化,保存到Service; 否则不保存。
Solution(解决方案): 运用DataGrid 的 itemEditBegin 事件、itemFocusOut 事件。
1.  when the itemEditBegin is dispatched, the event handler should save this cell value as old value.(编辑前保存旧值)
2. when the listener of itemFocusOut is responding, you should check the current cell to the old value. If it's value have changed, you should save the new value to Service.(编辑后判断,是否更改。)
Example(例子)  as follow:
<mx:Script>
        <![CDATA[
private var oldValueOfEditedItem: CreditVO;
   private function creditDGEditBegin(event: DataGridEvent): void {
             oldValueOfEditedItem = (event.itemRenderer.data as CreditVO).clone() as CreditVO;
            }
            private function editedItemChanged(newValue: CreditVO): Boolean {
             return (newValue.amount != oldValueOfEditedItem.amount)|| 
               (newValue.description != oldValueOfEditedItem.description);
            }
            private function creditDGEditEnd(event: DataGridEvent): void {
             var newValue: CreditVO = event.itemRenderer.data as CreditVO;
             if (editedItemChanged(newValue)) {
             dispatchEvent(new UpdateCreditEvent(newValue))
             }
            }
  ]]>
   &


相关文档:

Flex 启动基本流程


First, enough bytes for frame 1 are streamed down to the Flash
Player.
The Flash Player executes those bytes by creating a SystemManager
instance.
SystemManager instruct the Flash Player to stop at the end of frame
1.
SystemManager then goes on to create the Preloader which creates the ......

Flex 校验 文本框

 <mx:TextInput id="userName" maxChars="4" restrict="a-zA-Z" />
restrict属性确实可以输入正则表达式,进行输入的验证。
但是在程序执行的时候如果为userName.text = "999"还是可以成功的。
待续。。。。学习中。。。 ......

在Flex Chaet 中绘制3D图表

       前一阵在论坛上看到一个兄弟,想在Flex Chart中为图例设置3D效果,近几天查找了些资料,动手做了个DEMO供大家参考!
       DEMO演示地址http://xingjunli.webs.com/flash/flexChartDemo.swf,先来个图片看看最终效果: 
   相关知识点
......

Flex+java实现文件上传

用了两天时间学习了下Flex和java配合实现文件上传,找了个小例子。前端当然是flex,后台使用servlet,把代码贴上来,备忘吧:
FileUpload.java:
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletExc ......

Flex httpservice返回值类型和处理

返回数据的格式resultFormat有几种类型,object、array、xml、flashvars、text和e4x,默认的设置为object。
RESULT_FORMAT_ARRAY : String = "array"
[] 结果格式“array”与“object”相似,但是其返回的值始终为数组;这样,如果从结果格式“object”返回的结果尚不是数组,则将把该项 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号