3 Replies Latest reply on Jan 12, 2010 10:41 AM by Gregory Lafrance

    TextArea

    Daniel Cantin

      Hi,

       

           I am using an itemRenderer extending TextArea in AdvancedDataGrid control to display informations on shipmment. From there I am able to control background color of the cell using the code setStyle("backgroundColor", color) and it work ok. But sometimes there is more than one type of shipment for the same cell, for this kind of situation I would like to use more then one color in the background of the TextArea (fillColors) or change the border color of the TextArea.

       

      Regards,

        • 1. Re: TextArea
          Gregory Lafrance Level 6

          Just have color fields in the data, then the itemRenderer can access those fields to use the appropriate colors. Or you might have a data field shipmentType, and depending on what that value is you will use the appropriate background color.

           

          If this post answers your question or helps, please mark it as such.


          Greg Lafrance - Flex 2 and 3 ACE certified

          www.ChikaraDev.com

          Flex / AIR Development, Training, and Support Services

          • 2. Re: TextArea
            Daniel Cantin Level 1

            Hi,

             

                Thanks for the answer, I already have the fields I need to know the shipments I have for the cell. My question is how can I control my TextArea cell to be able to display more then one background color in the TextArea.

             

            Regards,

            • 3. Re: TextArea
              Gregory Lafrance Level 6

              In that case I would ditch TextArea and use a custom component based on Canvas.

               

              Then have <mx:Text> components, and use the getLineMetrics() to get the width and height of the text, and then draw rectangles behind the text.

               

              If this post answers your question or helps, please mark it as such.


              Greg Lafrance - Flex 2 and 3 ACE certified

              www.ChikaraDev.com

              Flex / AIR Development, Training, and Support Services