Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6533349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:06:52+00:00 2026-05-25T10:06:52+00:00

To display HTML formatted text in an AdvancedDataColumn, I’m using a custom renderer which

  • 0

To display HTML formatted text in an AdvancedDataColumn, I’m using a custom renderer which is an mx:Text object. I’m setting myText.htmlText to something like “test text which is really a lot longer than the column width”. No matter what properties I set though, the text just runs off the end of the column.

I tried wordWrap=”true” on the dataGrid and also on each individual column. I also tried messing with css and tried applying it to the text field, but nothing seems to show up. Has anyone been able to wrap htmlText in a text object?

Also, but slightly less important, there are extra blank lines after each tag which I would like to get rid of.

–Edit–added renderer code.

<?xml version="1.0"?>
<!-- itemrenderers/sparkmx/myComponents/SummaryRenderer.mxml -->
<s:MXAdvancedDataGridItemRenderer xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:mx="library://ns.adobe.com/flex/mx"
    xmlns:s="library://ns.adobe.com/flex/spark"
    textAlign="center">

    <fx:Script>
        <![CDATA[
            import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;

            override public function set data(value:Object):void
            {
                // help for style sheets
                //http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/StyleSheet.html

                //create and initialize css
                var myCSS:StyleSheet = new StyleSheet();
                myCSS.setStyle("p", {textAlign:'left'});
                // TODO try wordwrap here.
                myCSS.setStyle("div", {textAlign:'left'});

                //ensure html support and apply css to it
                myText.styleSheet = myCSS;

                // if the value is null, it would throw an error.
                if (AdvancedDataGridListData(listData) != null) {
                    myText.htmlText = value[AdvancedDataGridListData(listData).dataField];
                }
            }
        ]]>
    </fx:Script>

    <mx:Text id="myText"/>
</s:MXAdvancedDataGridItemRenderer>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:06:52+00:00Added an answer on May 25, 2026 at 10:06 am

    I figured out the first part. It looks like the Text object inside the cell was larger than the cell, so even though it was “wrapping” the text, it thought it had plenty of room.

    Adding in a

    myText.percentWidth=100;
    myText.percentHeight=100;
    

    to the set data function solved that problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using a UIWebView to display HTML formatted text. I am not loading
I have a JLabel that needs to display some html-formatted text. However, I want
I am developing an iPhone application and I use HTML to display formatted text.
How I can display HTML formatted text in .Net TextBox?
I want to display an HTML formatted content in my application preferably inside a
How can I display properly formatted text from an NSString, that just happens to
We have some HTML buttons which we format using JQuery - $('#button').button() . Works
I'm using Rails 3. I want to display generated html fragment inside erb template
I'm using the inputRichText component for composing HTML-formatted messages in a system I'm working
I want to display html text on a label(TTStyleLabel). I am receieving text in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.