Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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))
             }
            }
  ]]>
   &


Ïà¹ØÎĵµ£º

MyEclipse Flex»·¾³ÅäÖÃÏê½â

MyEclipse FlexµÄÅäÖÃÖ®³õÎÒÃÇ¿´¿´ÔµÓÉ£ºÒ»¿ªÊ¼Ñ§Ï°Ê¹ÓÃFlexµÄʱºò,ÎÒÊÇÓõĵ¥¶ÀµÄFlexBuilder3,×öЩ´¿FlexµÄÓ¦ÓóÌÐò»¹¿ÉÒÔ.µ«ÊÇÈç¹ûÒªºÍJava½áºÏÔÚÒ»ÆðʹÓÃ,¼´ÀûÓÃFLEX³äµ±Ò»¸öÍêÕûµÄJ2EEϵͳµÄWEB²ãµÄ»°,ÄÇôµ¥¶ÀʹÓÃFlexBuilder3ºÍMYECLIPSEÊǺܲ»·½±ãµÄ,´ó´óÓ°ÏìÁË¿ª·¢Ð§ÂÊ,Òò´Ë×öÁËÏÂMyEclipse+FlexµÄÅäÖÃ,´ïµ½Ö±½ÓÔÚ ......

netbeans + flex µÚÒ»¸öDEMO

  Ê×ÏȽ¨Ò»¸önetbeansµÄjava webÏîÄ¿
È»ºó´ÓÍøÉÏ°Éblazeds.war ÏÂÔØÏÂÀ´ÓÃrar ½âѹ °Ñweb-inf Ìæ»»µôÔÚnetbeans\web ÏÂÃæµÄweb-infÖеÄÈ«²¿Îļþ
È»ºó ²¿ÊðÏÂ
ÔÚ´ò¿ªflex builder н¨Ò»¸öflex project Ð´ÉÏÃû×ÖºÍÏîĿ·¾¶
ÔÚApplication server type Ñ¡ÖÐj2ee
µã»÷ ÏÂÒ»²½
È»ºó Root folderÑ¡ÖÐnet ......

Flash/Flexѧϰ±Ê¼Ç(7)£ºFMS3.5»ùÓÚIISµÄ°²×°

Ò»°ãÀ´½²£¬ÔÚwindowsÉÏ°²×°Èí¼þ´ÓÀ´¶¼²»ÊÇʲôÄÑʶù£¬µ«FMSÈ´ÔÚ°²×°¹ý³ÌÖÐ"³äÂú"ÁËÎóµ¼£¨ºÃ°É£¬ÆäʵҲ¾ÍÊÇ¿äÕŵÄ˵·¨¶øÒÑ£©
 
1.ÏÂÔØFMS3.5
http://www.adobe.com/products/flashmediainteractive/?promoid=DJDTG
ÕâÉÏÃæÓÐÒ»¸öÃâ·Ñ¿ª·¢°æ(³ýÁËÁ¬½ÓÊýÓÐÏÞÖÆ£¬ÆäËü¹¦ÄÜÍêÈ«Ò»Ñù)
 
2.һ·Next°²×°
 ×¢ ......

flexÖÐdataGridµÄ±à¼­¹¦ÄÜ

ÔÚflexµÄdataGridÖУ¬ºÜ¶àÇé¿öÏÂÁÐÊÇÐèҪǶÈëÆäËûµÄ¿ØÖƵģ¬±ÈÈ磺checkbox,comboxµÈ£¬´ËʱÐèÒªÀûÓÃdataGridµÄÈçϹ¦ÄÜ£º
1.datagrid±à¼­¹¦Äܼò½é
    µ±ÎÒÃǵã»÷datagridÖеÄÒ»¸öµ¥Ôª¸ñ½øÐб༭ʱ£¬¿É½áºÏʹÓÃһЩ×é¼þ£¬RadioButtonGroup¡¢checkbox¡¢ComboBoxµÈ
    datagridµÄ±à¼­¹¦Äܱ ......

Flexʼþ»úÖÆ»ù´¡(Ò»)

ºÜ¶à¿ª·¢ÈËÔ±¶¼ÖªµÀÈçºÎʹÓÃʼþ»úÖÆ£¬µ«È´²»Àí½âʼþ»úÖƵĻù±¾¹¤×÷Ô­Àí¡£ÔÚÕâÀïÎÒÃÇ̽ÌÖÒ»ÏÂActionScript 3µÄʼþ»úÖÆ(ÎÞÂÛÊÇÐÂÊÖ»¹ÊÇÀÏÊÖ£¬ÎÒÏàÐÅ¿´µ½×îºó¿Ï¶¨¶ÔÄãÓÐËù°ïÖú )¡£
1. Ê×ÏÈÀ´¿´Ò»ÏÂʼþ»úÖÆÖеļ¸¸ö»ù±¾¸ÅÄ
event objects(ÕâÀïÎÒÃǹÃÇÒ½ÐËüʼþ¶ÔÏó)£ºËùÓеÄʼþ¶ÔÏó¶¼ÊÇflash.events.Event»òÕßÆä×ÓÀà¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ