Forcing ComboBox to use htmlText

January 26, 2009

If your datasource values are in html format (I use <b></b> frequently to provide simple formatting and highlighting), you can simply force the textInput control that handles the display of the selected item text to use its htmlText field.

override protected function updateDisplayList(w:Number, h:Number):void
{
     super.updateDisplayList(w, unscaledHeight);
     // force use of htmlText
     textInput.htmlText = selectedLabel;
}

Not a completely robust solution, but it works nicely for me.  Occasionally I’ll use this with a custom list item renderer that does the same thing.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.