4 Replies Latest reply on May 28, 2009 9:07 PM by MacGyverMan

    Grow ADG row with itemEditor (DURING EDIT)

    MacGyverMan

      Hi, I am trying to use a TextBox as an itemEditor in an ADG.

       

      The user can enter text, and when they hit enter, an extra line shows up etc. I want the itemEditor to grow with the text, thereby forcing the ADG row to increase in size etc.

       

      Notes:

      - The ADG is marked as variableRowHeight

      - The ADG has wordWrap set to true

      - The ADG's editable colum is makerd wordWrap=trye, editorUsersEnterKey=true, itemEditor is a custom itemEditor with the following relevant code:

       

      public function keyDown_handler(e:KeyboardEvent):void
                  {
                      if(e.target.measuredHeight>this.height && e.target.measuredHeight<this.maxHeight)
                      {
                          this.measuredHeight=int(e.target.measuredHeight)+5;                                        
                      }       
                  }

       

      This code works more or less. The ADG row will grow, but only once the user has finished editing..that is, the ADG switches from the itemEditor to the itemRenderer. On the next edit, the itemEditor displays with the proper height.

       

      Can anyone help? I assume I need to commit the resize event or something.