9 Replies Latest reply on Sep 15, 2009 10:43 PM by _Natasha_

    problem in accessing textinput data from datagrid?

    435.mahesh Level 1

      Hi

      i have an datagrid inside that one column contains TextInputs as itemrenders.I want to access textinput

      data as user entered.How to access that textinput data?How to achieve that?

       

       

       

       

      Regards

      D.Mahesh Babu

        • 1. Re: problem in accessing textinput data from datagrid?
          _Natasha_ Level 4

          Hi,

          when any component used as an itemRenderer all data exchange throw data property.

           

          But editor and editor should only show and edit data. YOu don't need to access data.

           

          You also should set property rendererIsEditor and editorDataField.

          • 2. Re: problem in accessing textinput data from datagrid?
            Madhav Subedi Level 4

            you can set the change eventlistener of the textinput to be the functions in outerdocument( the function should be public.).

             

            however, have a study of "rendererIsEditor and editorDataField" as Natasha says.

            • 3. Re: problem in accessing textinput data from datagrid?
              435.mahesh Level 1

              Thanq.

              Here i want to access the textfield data and that data i want to send to the server by putting

              into valueobject.For that purpose i want to aceess that.How to do that?

               

               

               

               

              Regards

              D.Mahesh babu

              • 4. Re: problem in accessing textinput data from datagrid?
                435.mahesh Level 1

                Hi
                i thave textinput as itemreneder in datagrid.i want to textinput data because i want to send
                that textfield data to sever by putting in valueobject.How to achieve this?

                plz help me its urgent

                 

                 

                 

                 

                 

                 

                 

                Regards

                D.Mahesh babu

                • 5. Re: problem in accessing textinput data from datagrid?
                  _Natasha_ Level 4

                  This way:

                   

                  <mx:DataGrid>

                  <mx:columns>

                  <mx:DataGridColumn itemRenderer="mx.controls.TextInput"/>

                  </mx:columns>

                  </mx:DataGrid>

                  • 6. Re: problem in accessing textinput data from datagrid?
                    435.mahesh Level 1

                    I have finished that,but my requirement is i want to access that textinput data because i want to

                    put that textinput field data into valueobject like this.

                     

                    <mx:canvas>

                    <mx:script>

                      ----

                       public function fnSend()

                      {

                        var a:b=new b();

                           a.textdata=datagridTextiputdata;//Here textdata is field of valueobject.

                    }

                     

                    ---

                    </mx:script>

                    <mx:DataGrid>

                    <mx:columns>
                      <mx:DataGridColumn itemRenderer="mx.controls.TextInput"/>

                    </mx:columns>
                      </mx:DataGrid>
                    <mx:canvas>

                    • 7. Re: problem in accessing textinput data from datagrid?
                      _Natasha_ Level 4

                      Can you post part of your code and write, there is a problem?

                      • 8. Re: problem in accessing textinput data from datagrid?
                        435.mahesh Level 1

                        <mx:cnvas>

                        <mx:script>

                        public function fnSaveAttribute():void
                                {
                                 
                                     var var_valueobject_attribute:Attribute=new Attribute();

                                        var_valueobject_attribute.attributeName=here i want to write datagrid textinput value;            
                                      
                                        AttributeRO.fn_createNewAttribute.send(var_valueobject_attribute,"0");
                                          
                                }

                         

                        //attribute valueobject contains one field ie attributeName

                         

                         

                         

                         

                        </mx:script>

                        <mx:DataGrid height="139" width="287" id="id_attribute1" dataProvider="{var_arraycollection}">
                                                <mx:columns>
                                                    <mx:DataGridColumn headerText="Attribute Value" >
                                                    <mx:itemRenderer>
                                                        <mx:Component>
                                                       
                                                           <mx:TextInput  />
                                                      
                                                        </mx:Component>
                                                    </mx:itemRenderer>
                                                    </mx:DataGridColumn>

                        </mx:datagrid>

                        • 9. Re: problem in accessing textinput data from datagrid?
                          _Natasha_ Level 4

                          Ok... you can do something like this.

                          event focusOut is given as a example. You should choose event for sending data yourself.

                           

                          <mx:Script>

                          <![CDATA[

                          public function onFocusOut(event:Event):void

                          {

                           

                          }

                          ]]>

                          </mx:Script>

                          <mx:DataGrid>

                          <mx:columns>

                            <mx:DataGridColumn>

                            <mx:itemRenderer>

                            <mx:Component>

                            <mx:TextInput focusOut="outerDocument.onFocusOut(event)">

                           

                            </mx:TextInput>

                            </mx:Component>

                            </mx:itemRenderer>

                            </mx:DataGridColumn>

                          </mx:columns>

                            </mx:DataGrid>