FlexʵÏÖDataGridµÄÐòºÅÁÐ
ÒªÔÚFlexµÄDataGridÀïÌí¼ÓÐòºÅÁУ¬´óÌåÉÏÓÐÁ½ÖÖ·½·¨£º
ÉèÖÃDataGridColumnµÄlabelFunction¡£
Æä´óÖµÄ˼·ÊÇ£¬»ñÈ¡µ½µ±Ç°DataGridµÄdataProvider¼°µ±Ç°ÐеÄdata£¬µ÷ÓÃgetItemIndex·½·¨»ñÈ¡µ½µ±Ç°µÄÐеÄÐòºÅ¡£
¾ßÌå¿É²Î¿¼ http://wmcai.blog.163.com/blog/static/480242008111115724283/¡£ÕâÖÖ·½·¨±È½ÏÖ±¹Û£¬Ò²ºÜÈÝÒ×Ïëµ½¡£
µ«ÖØÓÃÐԺܲÆäÉú³ÉÐòºÅµÄlabeldFunctionÎÞ·¨ÖØÓá£
ÉèÖÃDataGridColumnµÄItemRenderer¡£
¼´×Ô¶¨ÒåÒ»¸öitemRendererÀ´´¦ÀíÐòÁкŵÄÉú³É¡£ÕâÖÖ·½·¨ÖØÓÃÐԺܸߡ£ÖÁÓÚÈçºÎÉú³ÉÐòºÅ£¬ÕâÀïÐèҪЩС¼¼ÇÉ¡£
SequenceItemRenderer.as
package com.carnation.component.common
{
import mx.collections.IList;
import mx.controls.Label;
import mx.controls.listClasses.BaseListData;
import mx.controls.listClasses.ListBase;
public class SequenceItemRenderer extends Label
{
public function SequenceItemRenderer()
{
super();
}
// ÁíÒ»ÖÖ·½·¨»ñÈ¡dataProvider²¢µ÷ÓÃgetItemIndex·½·¨
// override public function set data(value:Object):void{
// super.data = value;
// text = (((listData.owner as ListBase).dataProvider as IList)
// .getItemIndex(data) + 1).toString();
// }
override public function set listData(value:BaseListData):void{
super.listData = value;
text = ((value.owner as ListBase).itemRendererToIndex(this) + 1).toString();
}
}
}
Test.mxml
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" creationComplete="init()">
<mx:Script>
<!--[CDATA[
import com.carnation.component.common.SequenceItemRenderer;
private var indexRenderer:Class = SequenceItemRenderer;
private function init():void{
var array:Array = [];
for(var i:int = 1; i <= 10; i++){
array.push({name:"name"+i.toString()});
}
grid.dataProvider = array;
}
]]-->
</mx:Script>
<mx:DataGrid id="grid">
<mx:columns>
<mx:DataGridColumn headerText="no" itemRenderer="{new ClassFactory(inde
Ïà¹ØÎĵµ£º
cimmicolaÄÜ·ñ½²½²flex¿ª·¢¾Ñé(轉貼)Ó¦¸ÃÇå³þFlexÊÇÍêÈ«±àÒë³ÉswfÎļþºó½»ÓÉ¿Í»§¶Ëä¯ÀÀÆ÷ÖеÄFlash playerÀ´Ö´Ðеġ£¶ø²»Ïñ´«Í³webÓïÑÔ£¬¾ÓÉ·þÎñ¶Ë½øÐнâÊͺóת»¯Îª´¿htmlÔªËغͽű¾¡£
ÕâÑùÀ´Ëµ£¬Ò»¸ö´¿FlexÓ¦Óã¨Ö÷ÒªÊÇÖ¸ÆóÒµ¼¶¿ª·¢£¬Óкܶ๦ÄܺÍÒµÎñÁ÷³ÌµÄÄÇÖÖ£©±àÒëÖ®ºóµÄÌå»ý£¬»ù±¾ÉÏÊDz»ÄÜÔÚ»¥ÁªÍøÉÏ ......
»·¾³£ºeclipse 3.5 + tomcat 6.0 + flex builder 3.0 + blazeds-turnkey-3.2.0.3978.zip£¨adobeÍøÕ¾ÉÏÏÂÔØ£©
(ÒòΪ²»ÄܷŽØͼËùÒÔÖ»ÄÜÐðÊöÁË)
1£¬Ð½¨Ò»¸öjava webÏîÄ¿ ÀýÃûΪ :testjava;
2,Ôڴ˹¤³ÌÖÐдһ¸ö¼òµ¥µÄÀà:
package cn.com;
& ......
//»ñµÃÆÁÄ»µÄ·Ö±æÂÊ
var
x:Number=Capabilities.screenResolutionX;
var
y:Number=Capabilities.screenResolutionY;
Alert.show(
"x="
+x+
"y="
+y);
µÚ¶þÖÖ·½·¨
Alert.show(stage.fullScreenWidth+
"=="
+stage.fullScreenHeight);
//»ñµÃstage£¨¹¤×÷Çø£ ......
effects\Blinds.as
JScript code
package effects
{
import effects.effectClasses.BlindsInstance;
import mx.controls.scrollClasses.ScrollBarDirection;
import mx.effects.IEffectInstance;
  ......
ÏÂÔصØÖ·Ò»£º
http://download.macromedia.com/pub/flex/flex_builder/FB3_win.exe
´óС£º 424 MB £»Î´½øÐÐѹËõµÄ Flex Builder 3 °²×°Îļþ
²»ÓÃ×¢²áµÇ¼£¬¿ÉÒÔÖ±½ÓÏÂÔØ¡£
ÏÂÔصØÖ·¶þ£º
http://trials.adobe.com/Applications/.../FB3_WWEJ.exe
´óС£º¡¡385.84 MB¡¡£»¡¡ÒѾѹËõµÄ Flex Builder 3 °²×°Îļþ
ÐèҪע²á ......