0 Replies Latest reply on Jul 17, 2011 11:45 PM by Venkatesan Balasubramanian

    Implicit coercion Error while Adding Dynamic Rows To Flex DataGrid

    Venkatesan Balasubramanian Level 1

      Hi friends


      I   want to add interger for in next next rows while clicking tab   button,one i enter all the values in one row if i press tab means next   row will be editable.for making that i added the following code.i have   some error shows like this





                      private var tasks:ArrayCollection;
                      private static const ADD_TASK:int= "";
                      private function init():void
                          tasks = new ArrayCollection();
                          tasks.addItem(new Task(0.01,100000,0));
                      private function checkEdit(e:DataGridEvent):void
                          // Do not allow editing of Add Task row except for
                          // "Click to Add" column
                          if(e.rowIndex == tasks.length - 1 && e.columnIndex != 0)
              private function editEnd(e:DataGridEvent):void
                      // Adding a new task
                      if(e.rowIndex == tasks.length - 1)
                      var txtIn:TextInput =TextInput(e.currentTarget.itemEditorInstance);
                      var dt:Object = e.itemRenderer.data;
                      // Add new task
                      if(parseInt(txtIn.text) != ADD_TASK)
                          tasks.addItemAt(new Task(parseInt(txtIn.text), 0, ""), e.rowIndex);----->Multiple markers at this line:
                                                                                                                                 -1067: Implicit  coercion of a value of type String to an unrelated type int.

                      // Destroy item editor
                          // Stop default behavior




      Please help if any suggession



      Thanks in advance