I used the textInput cellrenderer in  datagrid,
and input text in textInput, but after add  two items,
the inputed data lost,

1.flex page:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";  
initialize="initDg()">
<mx:Script>
<![CDATA[
import com.ActionRequiredVO;

 var ActionRequireds: Array;
function initDg(){
        dg.addItem(new ActionRequiredVO());
        }
]]>
</mx:Script>
    <mx:VBox width="98%"  verticalGap="0">
                
            <mx:HBox width="100%" height="63" >
              <mx:Text text="Action Required:" width="110" 
textAlign="right"/>
    
              <mx:DataGrid id="dg" editable="true" rowCount="2" 
width="85%" 
                dataProvider="{ActionRequireds}">
                <mx:columns>
                    <mx:Array>

                                            <mx:DataGridColumn 
columnName="actionRequired" headerText="Action Required" 
width="{dg.width*0.7}" cellRenderer="PhoneTypeRenderer"/>
                        <mx:DataGridColumn columnName="assignedTo" 
headerText="Assigned To" width="{dg.width*0.15}"/>
                        <mx:DataGridColumn columnName="dueDate" 
headerText="Due Date" width="{dg.width*0.15}"/>
                    </mx:Array>
                </mx:columns>
              </mx:DataGrid>
           
                          <mx:VBox>
              <mx:Button label="+" click="dg.addItem(new 
ActionRequiredVO())"
                    cornerRadius="0" borderThickness="0" width="20" 
height="20" toolTip="Add new item"/>
                <mx:Button label="-" click="dg.removeItemAt
(dg.selectedIndex)"
                    cornerRadius="0" borderThickness="0" width="20" 
height="20"/>
              </mx:VBox>
            </mx:HBox>
          </mx:VBox>
</mx:Application>

2.ActionRequiredVO.as

class com.ActionRequiredVO {

        public var dueDate : String;
        public var assignedTo : String;
    public var actionRequired :String;
    static var registered=Object.registerClass
("com.ActionRequiredVO", com.ActionRequiredVO);
        
        function ActionRequiredVO(actionRequired:String){
                
                this.actionRequired = actionRequired;
                
                
        }
  
   

}
3.ActionRequiredVO.java
package com;
public class ActionRequiredVO {
        
        private String actionRequired = null;
        private String assignedTo  = null;
        private String dueDate = null;

        /**
         * @return
         */
        public String getActionRequired() {
                return actionRequired;
        }

        /**
         * @return
         */
        public String getAssignedTo() {
                return assignedTo;
        }

        /**
         * @return
         */
        public String getDueDate() {
                return dueDate;
        }

        /**
         * @param string
         */
        public void setActionRequired(String string) {
                actionRequired = string;
        }

        /**
         * @param string
         */
        public void setAssignedTo(String string) {
                assignedTo = string;
        }

        /**
         * @param string
         */
        public void setDueDate(String string) {
                dueDate = string;
        }

}




I am glad to get your help!thanks
 




--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to