flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From OmPrakash Muppirala <bigosma...@gmail.com>
Subject Re: Style First Word of List Items Differently
Date Fri, 10 Oct 2014 17:54:49 GMT
There are multiple ways to do this, but using RichText would give you a lot
of flexibility:

1.  Create a custom itemrenderer with a [Bindable] var textFlowXML;
2.  In the set data(value:Object) method, add this:
    override protected function set data(value:Object):void
    {
                super.data = value;
                var firstWord:String = data.firstWord;
                var secondWord:String = data.secondWord;
                this.textFlowXML = <TextFlow xmlns="
http://ns.adobe.com/textLayout/2008" whiteSpaceCollapse="preserve">
                                    <p>
                                        <span fontWeight="bold"
color="#FF6600">{firstWord} </span>
                                        <span
fontWeight="normal">{secondWord} </span>
                                    </p>
                                </TextFlow>;
    }

3.  In the body of the itemrenderer, add a RichText element:
                <s:RichText
textFlow="{TextFlowUtil.importFromXML(textFlowXML)}">

This should work.  Let me know if there are issues.

Thanks,
Om


On Thu, Oct 9, 2014 at 12:17 PM, Devesh Mishra(NABFS00) <
devesh.dmishra@igate.com> wrote:

> You can try to set style to item renderer label component.
>
> --
> Thanks & Regards,
> Devesh Mishra
>
> -----Original Message-----
> From: Tintin [mailto:1955.mille.miglia@googlemail.com]
> Sent: Friday, October 10, 2014 12:32 AM
> To: users@flex.apache.org
> Subject: Style First Word of List Items Differently
>
> Hello
>
> I have a List displaying several items. Lets say there are 3 items in the
> List: "Green Apples", Yellow Bananas" and "Red Cherries". The List has an
> ArrayCollection data source.
>
> I want to style the first word of each item with a different text style to
> the second (or other) words. Is this possible?
>
> I can only see how to set a style to the complete List Item.
>
> Thank you.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Style-First-Word-of-List-Items-Differently-tp8361.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Disclaimer~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Information contained and transmitted by this e-mail is confidential and
> proprietary to IGATE and its affiliates and is intended for use only by the
> recipient. If you are not the intended recipient, you are hereby notified
> that any dissemination, distribution, copying or use of this e-mail is
> strictly prohibited and you are requested to delete this e-mail immediately
> and notify the originator or mailadmin@igate.com <mailto:
> mailadmin@igate.com>. IGATE does not enter into any agreement with any
> party by e-mail. Any views expressed by an individual do not necessarily
> reflect the view of IGATE. IGATE is not responsible for the consequences of
> any actions taken on the basis of information provided, through this email.
> The contents of an attachment to this e-mail may contain software viruses,
> which could damage your own computer system. While IGATE has taken every
> reasonable precaution to minimise this risk, we cannot accept liability for
> any damage which you sustain as a result of software viruses. You should
> carry out your own virus checks before opening an attachment. To know more
> about IGATE please visit www.igate.com <http://www.igate.com>.
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message