flex DataGrid±à¼µ¥Ôª¸ñ²¢»ñȡеÄÖµ
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Panel width="458" height="313" layout="absolute">
<mx:Label id="lbl" x="19" y="10" text="" width="171" height="20"/>
<mx:DataGrid id="dg" x="19" y="58" dataProvider="{arr}" editable="true" itemEditEnd="editHandle(event)"
horizontalGridLines="true" horizontalGridLineColor="#B9F2C9" verticalGridLineColor="#B9F2C9">
<mx:columns>
<mx:DataGridColumn headerText="year" dataField="year" editable="false"/>
<mx:DataGridColumn headerText="city" dataField="city" editable="false"/>
<mx:DataGridColumn headerText="provice" dataField="provice" editable="false" sortable="false"/>
<mx:DataGridColumn headerText="total" dataField="total"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
<mx:Script>
<!--[CDATA[
import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.DataGridEvent;
import mx.controls.Alert;
import mx.collections.ArrayCollection;
[Bindable]
private var arr:ArrayCollection=new ArrayCollection([
{year:2009,city:"Shanghai",provice:"ÉϺ£",total:580000},
{year:2009,city:"Beijing",provice:"ºÓ±±Ê¡",total:7852020},
{year:2009,city:"Nanjing",provice:"½ËÕÊ¡",total:895145},
{year:2009,city:"Hangzhou",provice:"Õã½Ê¡",total:4132415}]);
private function editHandle(event:DataGridEvent):void{
if(event.dataField=="total"){
var cols:DataGridColumn=dg.columns[event.columnIndex];
///±à¼Ç°µÄÖµ,ûÓõ½£¬Ö»ÊÇÏë»ñµÃÒ»ÏÂ
var s:String=event.itemRenderer.data.total;
//±à¼ºóеÄÖµ
var newValue:String=dg.itemEditorInstance[cols.editorDataField];
var num:Number=Number(tt);
if(isNaN(num)){
event.preventDefault();//»Ö¸´±¾À´Êý¾Ý
lbl.text="this is not num!";
}else{
lbl.text=tt;
/*=======²Ù×÷Êý¾ÝºÍÊý¾Ý¿â´ò½»µÀ=========*/
/*Ê¡ÂÔ*/
}
}
}
Ïà¹ØÎĵµ£º
ÔÚͬһ¸öApplicationÖж¯Ì¬Çл»Ö÷Ì⣬ÕâÀï²ÉÓõÄÊǶ¯Ì¬ÒýÓò»Í¬µÄCSSÎļþ¡£
¾ßÌå²½ÖèÈçÏ£º
1£©´´½¨CSSÎļþ
skyTheme.css
/* CSS file */
.backgroudSkin
{
&nbs ......
TypeError: Error #1034: 強ÖÆÐÍ変換¤Ëʧ敗¤·¤Þ¤·¤¿¡£jp.co.nec.necst.pi.ap2web::TestEvent@1645ee79 ¤ò jp.co.nec.necst.pi.ap2web.TestEvent ¤Ë変換¤Ç¤¤Þ¤»¤ó¡£
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispat ......
½â¾öʹÓÃFlex ÎÞ·¨Ê¹ÓÃtraceµÄÎÊÌâ
³öÏÖÁËʹÓÃDebug¹¦ÄܳöÏÖÁËÎÞ·¨Ê¹ÓÃtraceµÄÎÊÌâ
Õâ¸öÎÊÌâ˵Ã÷ÄãµÄFlash Player 10 ²»Êǵ÷ÊÔ°æ±¾
ÌṩһÏÂAdobe Flas Player 10µ÷ÊÔ°æ±¾µÄµØÖ·....
Ï£ÍûÄܶԴó¼ÒÓаïÖú
http://download.macromedia.com/pub/flashplayer/updaters/10/flashplayer_10_ax_debug.exe
......
ÈýÄêǰ£¬ÓùýAmfPHPÓëFlash/Flex
Remoting×ö¹ý½»»¥£¬×î½ü½Ó´¥Python£¬¹«Ë¾ÏîÄ¿ÓõÄFlex×öǰ¶Ë£¬ËùÒÔ½Ó´¥ÁËPyAmf¡£PyAmf±¾ÖÊÉϸúAmfPHPÊÇÀ×ͬµÄ¡£¶¼ÊÇͨ
¹ý¶ÔAMFÐÒ飨ActionScript Message Format£©ÐÒéµÄÖ§³ÖÀ´ÊµÏÖ¶ÔFlashµÄ½»»¥¹ý³Ì¡£
Ò»¡¢Ê×ÏÈ£¬¼òµ¥µÄ½éÉÜÒ»ÏÂAMFÐÒé¸ñʽ¡£
AMFÊÇAdobe¶À¼Ò¿ª·¢³öÀ´µÄͨÐÅÐÒ飬Ëü²É ......
<?xml version="1.0" encoding="utf-8"?>
<!-- http://yecon.blog.hexun.com/28902341_d.html -->
<!-- http://www.slsay.com -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
&nb ......