4 Replies Latest reply on Sep 17, 2008 1:02 AM by nikos101

    I can't get the datagrid  columns to word wrap

    nikos101 Level 2
      I find that if I have a custom item renderer for a datagrid column then I can't get the particular columns to word wrap, as you usually can in columns without item renderers

      Does anyone know how to do this?
        • 1. Re: I can't get the datagrid  columns to word wrap
          nikos101 Level 2
          I found a class that lets me do this:

          package components.extendedComponents
          {
          import flash.events.KeyboardEvent;
          import flash.events.TextEvent;

          // import ms.imfusion.util.view.smiley.*;

          import mx.controls.TextArea;
          import mx.states.SetStyle;

          public class AutoResizingTextInput extends TextArea
          {

          public var my_height:Number;
          public var my_width:Number;
          // public var imgobjectparser:ImgObjectParser;

          private var __realText:String;

          public function AutoResizingTextInput()
          {
          super();
          //imgobjectparser = new ImgObjectParser(this);
          this.addEventListener(TextEvent.TEXT_INPUT, textInputHandler);
          /* setStyle("borderStyle","solid"); */
          }

          public function set realText (str:String):void {
          __realText = str;
          }

          public function get realText ():String {
          return __realText
          }

          override public function set htmlText (str:String):void {
          // imgobjectparser.parseImgSringObj(str,this.textField);
          }

          protected function textInputHandler(event:TextEvent = null):void
          {
          //this.invalidateSize();
          }

          override protected function keyDownHandler(event:KeyboardEvent):void
          {
          super.keyDownHandler(event);
          this.invalidateSize();
          }

          override protected function updateDisplayList(unscaledWidth:Number,
          unscaledHeight:Number):void
          {
          super.updateDisplayList(unscaledWidth, unscaledHeight);
          this.height = this.textField.textHeight+4;
          my_width = this.textField.textWidth
          this.textField.scrollV = 0

          }

          }
          }
          • 2. Re: I can't get the datagrid  columns to word wrap
            EvolvedDSM Level 2
            Just to cover the basics, you are setting variableRowHeight and wordWrap to true in your datagrid?
            • 4. Re: I can't get the datagrid  columns to word wrap
              nikos101 Level 2
              After trying out the above class there are problems with the datagrid, things like rows overlapping other rows and stuff :(