Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Flex: °´±ÈÀýÉèÖÃDataGirdµÄÁпí

FlexÀïÃ棬DataGridµÄcolumnµÄwidthÊôÐÔ²»½ÓÊܰٷֱȣ¬Ö»½ÓÊÜÒ»¸ö¾ßÌåµÄÏñËØÖµ£¬ËùÒÔ£¬Èç¹ûÏë°´ÕÕ±ÈÀýÀ´ÉèÖÃÁпíÐèÒª·ÑЩÖÜÕÛ¡£GoogleÁËһϣ¬ÓÐÁ½ÖÖ·½·¨¿ÉÒÔ×öµ½£º µÚÒ»ÖÖ·½·¨£¬²»ÒªÉèÖÃwidthΪ°Ù·Ö±È£¬¶øÉèÖÃΪһ¸öСÊý£¬ËùÓÐÁеÄСÊýÖµµÄºÍ±ØÐëΪ1¡£ <mx:DataGrid width="100%" height="100%">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name" width=".25" />
<mx:DataGridColumn headerText="Age" dataField="age" width=".15" />
<mx:DataGridColumn headerText="Job" dataField="job" width=".35" />
<mx:DataGridColumn headerText="Height" dataField="height" width=".25" />
</mx:columns>
</mx:DataGrid>
²Î¼û£ºhttp://www.switchonthecode.com/tutorials/flex-datagrid-percentage-width-columns
ÕâÖÖ·½·¨±È½Ï¼òµ¥Ã÷ÁË£¬µ«ÊÇÈç¹ûÄãµÄÏîÄ¿²»ÊÇÓõıê×¼FlexµÄ¿â£¬¶øÊÇ×Ô¼º¹«Ë¾¿ª·¢µÄ¿â£¬ÄÇôÉÏÃæµÄ¾Í¿ÉÄܲ»¹¤×÷£¬ÄÇô¾ÍÖ»ÄܲÉÓÃÏÂÃæÒ»ÖÖ·½·¨ÁË¡£
 
µÚ¶þÖÖ·½·¨£ºÔÚDataGridµÄcreationComplete()»Øµ÷º¯ÊýÖÐÊÖ¶¯ÉèÖÃÁÐ¿í£¬¿´ÏÂÃæµÄ´úÂ룺
<mx:Script>
<![CDATA[
function setRelativeColWidths(){
dg1.getColumnAt(0).width =dg1.width*.10;
dg1.getColumnAt(1).width =dg1.width*.15;
dg1.getColumnAt(2).width =dg1.width*.50;
dg1.getColumnAt(3).width =dg1.width*.10;
dg1.getColumnAt(4).width =dg1.width*.15;
}
]]>
</mx:Script>
<mx:DataGrid id="dg1" editable="false" hScrollPolicy="off" rowCount="5"
width="50%" creationComplete="setRelativeColWidths()" resize="setRelativeColWidths()>
 
ÔÚcreationCompleteµÄ»Øµ÷º¯ÊýsetRelativeColWidths·½·¨ÖУ¬¶ÔÿһÁа´ÕÕ±ÈÀýÉèÖÃÁËÁÐ¿í¡£
²Î¼û£ºhttp://kb2.adobe.com/cps/224/224468bb.html
µ«ÕâÖÖ·½·¨ÓиöÎÊÌ⣺ÉèÖÃÁпíºó£¬Èç¹ûDataGrid×ÔÉí´óС·¢Éú±ä»¯ºó£¬ÁеĿí¶È²»»á×Ô¶¯µ÷Õû£¬Òò´ËÔÙÔÚresizeµÄʱºòÈÃÆäµ÷ÕûÒ»´ÎÁÐ¿í£¬ÕâÑù¾ÍÍêÃÀÁË¡£


Ïà¹ØÎĵµ£º

Flex Óë java ͨѶ ¡¾×ª¡¿

    2.2 ´úÂëʵÏÖ
      ÏÂÃæ¸ø³öÁËFlexBuilder¹¤³ÌµÄÒ»¸öÎļþ£¬ÉèÖÃÁËFlashµÄ²¼¾Ö¡£
     view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
......

Flex Óë servlet ͨÐÅ

servlet ¶Ë£º
String userId = request.getParameter("userId");
System.out.println(userId);
response.setCharacterEncoding("UTF-8");
response.getWriter().println("hello world -- ÎÒ°®Äã¡£¡£¡£");

Flex ǰ̨¶Ë
<fx:Script>
<![CDATA[
import flash.trace.Trace;
private var loader:UR ......

flexµÄCanvas¿ÉÒÔºÍHTMLµÄDIVÒ»Ñù×ö¿é×´µÄÍø¸ñ²¼¾Ö

Óõ½µÄMX±êÇ©£ºconstraintColumns¡¢ConstraintColumn¡¢constraintRows¡¢ConstraintRow
¸ø´ó¼Ò˵˵ǰÌáÇé¿ö£ºÔÚ×öMXML²¼¾Öʱ£¬ÒªÇ¶Ì׺ܶà²ã¼¶£¬ÕâÀïÃæÓкܶàÎÊÌ⣺
1¡¢Ç¶Ì×Ì«¶à²ã¼¶»áÓ°ÏìЧÂÊ£¡
2¡¢Ç¶Ì×Ì«¶à²ã¼¶£¬´úÂëµÄ¿É¶ÁÐÔ¡¢¿Éά»¤ÐԲ
3¡¢Ç¶Ì×Ì«¶à²ã¼¶ÊÇÒòΪCanvas¡¢Vbox¡¢Hbox¹¦Äܵ¥Ò»£¬²»ÄÜÂú×ãÐèÒª£¬¶ø²»ÊDZØÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ