5 Replies Latest reply on Jul 18, 2011 2:18 AM by EvyatarBH

    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 static const ADD_TASK:int = 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(txtIn.text != ADD_TASK).---->error : Comparison between a value with static type String and a possibly unrelated type int
                          tasks.addItemAt(new Task(txtIn.text, 0, ""), e.rowIndex);----> error:Implicit coercion of a value of type String to an unrelated type int.
                      // Destroy item editor
                          // Stop default behavior


      Please if any suggession welcome.



      Thanks in advance.